score:0
by default, chart.js automatically calculates how many labels can be shown and hides labels accordingly. this is controlled by ticks.autoskip
that has default value true
.
if you explicitly define yaxes.ticks.stepsize
however, autoskip
is ignored and a tick is shown for all matching steps.
solution 1
the easiest solution is to remove yaxis.ticks
from the options and let autoskip
manage tick generation.
solution 2
you may also increase stepsize
and choose whatever suits you.
yaxes: [{
ticks: {
stepsize: 10
}
}]
solution 3
another option would be to define the exact number of ticks to be show using yaxes.ticks.maxtickslimit
.
yaxes: [{
ticks: {
maxtickslimit: 5
}
}]
Source: stackoverflow.com
Related Query
- How to control the over riding of Y-axis values in Chart.js when more entries inserted using PHP?
- Moving vertical line when hovering over the chart using chart.js
- chart js tooltip how to control the data that show
- How do I change the 'months' language displayed on the date axis in Chart JS?
- How to change the cursor to a pointer when I hover over a bar in a ChartJS bar chart?
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- Hovering over chart.js values in Meteor onRendered function causes chart axis shift
- How to commaize the data values provided to a chart in Chart.JS?
- How can I add a unit to the end of my Y Axis values in ChartJS?
- How can I have different values for the chart and the tooltip in chart.js?
- chart.js: How do I make the radar chart axis labels bigger?
- How to set the xAxes min and max values of time cartesian chart in Chart.js
- How to set custom Y Axis Values (Chart.js v2.8.0) in Chart Bar JS
- How can I re-distribute values within a charts.js pie chart when a legend item is turned off/on?
- How to clear/destroy Chart.js canvas when the chart is represented as a react JSX element
- How to show tooltip value of all data falling on the same axis in chart js?
- How to show the chartjs bar chart data values labels as text?
- ChartJS: Highlight dataset in a stacked bar chart when hovering over the legend?
- Chart.js How to sum the values in a pie chart and display them in the header
- How to display the values inside the pie chart of PrimeNG (chart) using JavaScript or Angular
- chart js: when all the values passed to data are zeros, nothing is showing
- How to remove the extra Y axis from a bar chart in chart.js
- How to stop displaying the data values from different data objects on Chart JS 2.x?
- How can I remove the white border from Chart.js pie chart when all legends are hidden?
- Moving vertical line when hovering over the chart using chart.js in v2.9.4
- How to add custom text inside the bar and how to reduce the step size in y axis in chart js( Bar chart )
- How to fix a stacked logarithmic bar chart values to fit the grid
- How to start Y Axis Line at 0 from right for negative values in chart js 2?
- chart does not change the values when the variable changes the value
More Query from same tag
- Chartjs - Shift line plot to the right?
- ReactJs: componentWillReceiveProps doesn't get called for component whose redux action gets dispatched last
- c# Chart.Js and JSON with NewtonSoft
- Horizontal Bar-Chart - angular-chart.js
- Is it possible to scale Chart.js background Image
- chart.js label color change based on value
- How to use chart.js in Angular2?
- ng2-charts - bar chart, showing only one color
- Display Chart.js chart in Node.js
- Angular chartjs directive
- how to highlight the bars in stacked bar chart of chart.js on clicking a legend
- Displaying labels on a Doughnut Chart using Chart.js
- chart.js remove on hover effect
- How to generate color code dynamically by swapping 2 characters within a string using PHP
- How to group chart labels together?
- Can we draw a Line Chart with both solid and dotted line in it?
- Data with pair X and Y values
- chart js, loading data dynamically
- Parsing an unnamed JSON array into React component
- make chartJS labels clickable and get label details
- Multiple bubble chart datasets for chartjs
- Can not read property 'Concat' of Undefined
- Chart.js br chart only displaying first value
- Display Time In Y Axis - Bubble Chart
- Use Google Spreadsheet as data source for Chart.js
- How to import Chart.js chartjs-plugin-datalabels npm package into an Angular 7 project
- Is there anyway to keep chart label across
- how to add second axes to chart JS
- Rails 4.2 jQuery loads only after refresh
- How to create a Doughnut chart in django admin interface using foreign key field data?