Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new align 'inner' for X axis (#10106)
* Add new align for X axis new align 'left-right' for options.scales['x'].ticks namespace will allow users to aling ticks: 'start" for first (left) tick and 'end' for last (right) tick * corrected name of aligment to "inner", documentation and add test for inner labels * delete unnecessary changes * corrected logic for reverse axis, add tests for reverse axis and withoutY axis * corrected chart paddings for "inner" tick align * code clearness * Update types/index.esm.d.ts Co-authored-by: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com> Co-authored-by: Talla2XLC <alexey.ivanov@epc.com.ru> Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com> Co-authored-by: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>
- Loading branch information
1 parent
ed8fa1b
commit 7c14ab7
Showing
11 changed files
with
132 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
config: { | ||
type: 'line', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Label1_long', 'Label2_long', 'Label3_long'] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
ticks: { | ||
align: 'inner', | ||
}, | ||
}, | ||
y: { | ||
display: false | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
config: { | ||
type: 'line', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Label1', 'Label2', 'Label3'] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
ticks: { | ||
align: 'inner' | ||
}, | ||
reverse: true | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module.exports = { | ||
config: { | ||
type: 'line', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Label1', 'Label2', 'Label3'] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
ticks: { | ||
align: 'inner', | ||
maxRotation: 45, | ||
minRotation: 45 | ||
}, | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = { | ||
config: { | ||
type: 'line', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Label1', 'Label2', 'Label3'] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
ticks: { | ||
align: 'inner', | ||
}, | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters