0👍
From the documentation:https://www.chartjs.org/docs/latest/axes/
The default configuration for a scale can be easily changed using the scale service. All you need to do is to pass in a partial configuration that will be merged with the current scale default configuration to form the new default.
For example, to set the minimum value of 0 for all linear scales, you would do the following. Any linear scales created after this time would now have a minimum of 0.
Chart.scaleService.updateScaleDefaults(‘linear’, {
ticks: {
min: 0
}
});
- Chartjs-Resize pie chart from chart.js
- Chartjs-C# MVC5 JavaScript Chart.js Pie Chart with Realtime Updating from SQL Server Database without Refreshing
Source:stackexchange.com