score:11
Accepted answer
Use the afterBuildTicks option for the scales/yAxes
yAxes: [{
ticks: {
min: 0,
max: 100
},
afterBuildTicks: function(humdaysChart) {
humdaysChart.ticks = [];
humdaysChart.ticks.push(0);
humdaysChart.ticks.push(50);
humdaysChart.ticks.push(100);
}
}]
or you can also use 'stepSize'
yAxes: [{
ticks: {
min:0,
max:100,
stepSize:50
}
}]
Source: stackoverflow.com
Related Query
- chart.js: hide specific ticks in y-axis and hide all x-axis grid line
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- Chart with Time axis only displaying first grid line and tick label (unitStepSize)
- How to show tick marks and labels with grid line for the specific one on the X axis with Chart.js?
- ChartJs line chart time cartesian axis number of ticks and wierd offset
- Chart.js 3.4/Vue3 How to hide border ticks and set specific amount of grid lines
- how to only show zero grid axes at center and hide all other gridlines in chart js
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Chart.js bar chart : Grid color and hide label
- Show X axis on top and bottom in line chart rendered with Chart.js 2.4.0
- Specific grid line in X axis in ChartJs
- How to change the label and grid line position on a timeseries chart in Chart.js 3?
- How do you set x and y axis and Title for a line chart using charts.js?
- How to remove all gridlines and ticks all lines in lines chart in javascript taken from cdn)
- X and Y axis labels not displaying on line chart (Chart.js)
- Google Charts, HighCharts or ChartJS Dual Axis Gantt Chart and Line Chart Visualization
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Line chart plotting multiple points for duplicate data on x and y axis using chart.js
- Not all date data shows on x axis line chart
- How to configure chart.js line chart with very low minimum height, and only 0 and 1 (no decimals) as ticks on the y-axis
- Multiple axis line chart with Chart.js and JSON data from Google Sheet
- In Chart.js set chart title, name of x axis and y axis?
- How to hide y axis line in ChartJs?
- Hide min and max values from y Axis in Chart.js
- show label in tooltip but not in x axis for chartjs line chart
- How to add second Y-axis for Bar and Line chart in Chart.js?
- Chart.js Mixed Bar and Line chart with different scales
- Obtain max value of y axis of line chart rendered with Chart.js
- Changing x axis labels in Chart.js line chart
- Draw a horizontal and vertical line on mouse hover in chart js
More Query from same tag
- Chart JS 2.x: How to show a tooltip in a timeline chart?
- Align Title Left React Chart.js V2
- angular 5 chart.js Failed to create chart
- Chart.js add tooltip at intersection of axes (break even)
- Passing the same props while rendering different elements conditionally in React.js
- Canvas line chart on this graph stretch beyond the assigned lengths
- Legends for line charts in Chart.js
- How to improve PDF rasterization quality in PhantomJS?
- Angular 4:PrimeNg DoughnutChart dynamic data issue.
- Tiny error in the ChartJs book
- Problem with changing string to date with time
- How to remove the line/rule of an axis in Chart.js?
- Chartjs to show more set of data of click of a button
- Chart.js calculates the width of my time x-axis wrong
- Bar charts not getting displayed correctly when bar is below zero (chart.js)
- Chart.js v2 is there a way to draw bar chart horizontally?
- how to label the x and y axis - in a line graph
- Chart.js v2.0: Tooltip only for one dataset
- Chartjs Tooltip Line Breaks
- React-Chart.js : How do I increase the space between the legends and chart?
- Chartjs bar-chart does not render when values are equal
- Array data not rendering in data table using this.props - ReactJS
- How to get values inside a chart without clicking
- Chart js not working properly in Safari
- Django integration with Charts.js, I'm unable to find the syntax for passing the data to the template
- Chart.js custom tooltipTemplate index
- Chart.js javascript from db stopped working after adding axes
- ChartJS radar-chart hover text
- how to use javascript library in dart
- react-chartjs-2 keep x axis always 0% to 100%