feat(chart.js): add 'sampleSize'. Closes #40775 (#41525)

Thanks!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz)
2020-01-13 09:20:54 -08:00
committed by Ryan Cavanaugh
parent 4e23dab093
commit 25dcc2cabf
2 changed files with 10 additions and 1 deletions
+3 -1
View File
@@ -68,6 +68,7 @@ const chart: Chart = new Chart(ctx, {
{
ticks: {
callback: Math.floor,
sampleSize: 10,
},
gridLines: {
display: false,
@@ -266,7 +267,8 @@ const linearScaleChart: Chart = new Chart(ctx, {
distribution: 'series',
ticks: {
source: 'data',
autoSkip: true
autoSkip: true,
sampleSize: 1,
}
}],
yAxes: [{
+7
View File
@@ -563,6 +563,13 @@ declare namespace Chart {
mirror?: boolean;
padding?: number;
reverse?: boolean;
/**
* The number of ticks to examine when deciding how many labels will fit.
* Setting a smaller value will be faster, but may be less accurate
* when there is large variability in label length.
* Deault: `ticks.length`
*/
sampleSize?: number;
showLabelBackdrop?: boolean;
source?: 'auto' | 'data' | 'labels';
stepSize?: number;