diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 3f391ddd5a..6a1bc49819 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -276,6 +276,9 @@ const linearScaleChart: Chart = new Chart(ctx, { scaleLabel: { display: true, labelString: 'Closing price ($)' + }, + afterBuildTicks: (scale, ticks) => { + return [Math.max(...ticks), 10, Math.min(...ticks)]; } }] }, diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 0fc117a483..e19f71e7be 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -718,7 +718,7 @@ declare namespace Chart { afterUpdate?(scale?: any): void; afterSetDimension?(scale?: any): void; afterDataLimits?(scale?: any): void; - afterBuildTicks?(scale?: any): void; + afterBuildTicks?(scale: any, ticks: number[]): number[]; afterTickToLabelConversion?(scale?: any): void; afterCalculateTickRotation?(scale?: any): void; afterFit?(scale?: any): void;