score:3
Accepted answer
There is an easier workaround to do this. Just add a null
to the end of your data array, like so
var barData = {
labels: ["January", "February", "March", "April", "May", "June"],
datasets: [
{
fillColor: "#48A497",
strokeColor: "#48A4D1",
data: [45, 47, 124, 56, 70, 60, null]
}
]
};
score:0
I have taken the greatest value from the data and divide it with the ScaleSteps and set in scaleStepWidth so it becomes custom scale according to my highest value.
var myBarChart = new Chart(document.getElementById("id").getContext("2d")).Bar(BarChart, {
animation: false,
scaleOverride: true,
scaleSteps: 10,
scaleStartValue: 0,
scaleStepWidth: 20
});
Now the Sacle will be 0 to 200. which is OK for me.
Source: stackoverflow.com
Related Query
- How to set the chartjs bar graph scale to the highest value in the result data
- chartjs : how to set custom scale in bar chart
- How to set lower limit for the highest value being displayed on Y Axis?
- How to set the gap between data items in a chartjs chart
- How to show the chartjs bar chart data values labels as text?
- how to show bar value on the top of each bar in chartjs
- How to sum the array value in javascript like chartjs data array and input value sum
- How do you remove the data value from the mouse-over result in radar chart?
- How can i get the Chart JS Bar Graph Bar Label and Value on click?
- How to change the cursor to a pointer when I hover over a bar in a ChartJS bar chart?
- Chartjs 2.7.3: Set Y data at the correct X position axis
- How to set a full length background color for each bar in chartjs bar
- Chart JS display Data Value on the top of the Bar
- How to remove bars for those bars with zero value in Chartjs bar chart?
- Angular chart how to show the legend data value by default along with legend name
- dynamically update the scale type of chartjs graph
- How to make chartJs stacked bar always rounded when data is 0?
- chartjs - how to set the order in which the different charts are displayed
- Chartjs - Set start and end value into a Bar Chart
- How can I load multiple Chartjs charts with different data on the same page?
- How do I customize y-axis labels and randomly pick the value from the data range for x-axis in Chart js
- How can I set the yAxis scale for the chart?
- Angular 2: How to pass my API data to graph and Display the Graph with data
- How to use set the color for each bar in a bar chart using chartjs?
- Chart.js - how to add a second data line to the line graph
- Chart.JS: How can I only display data labels when the bar width is big enough for the text?
- How to create a custom tooltip for chartJS graph with data in JSON array in JavaScript?
- Display Bar chart values in the graph - ChartJS
- How to get the database data into ChartJS using codeigniter
- How can I append a calculated value to the end of a bar in Chart.JS?
More Query from same tag
- How to add multiple background color in line charts
- chartjs V3 align legend text
- Setting dynamic state data in Chart.JS + React
- ChartJS Radar Chart radar lines color?
- How to remove the inside-border from doughnut chart? Chart.js
- ChartJS add text to canvas in linechart
- Customization of Data Labels in doughnut chart ng2-charts
- Chart.JS Get Json data for chart and return dataset where a type equals a certain type
- Chartjs extended doughnut with text tooltip issue
- concatenate on tooltip from data array in chart js
- Am I missing a chart.js component or helper?
- Chart.js: How to change the x-Axes background color?
- How to plot dates in Chart.js
- Styling problems with Chart.Js
- Chart.js - Multiple generateLegend() functions on same page
- Background-color for area below line chart in chartJs?
- ng2-charts How to get the result of multiple push?
- Highlight doughnut segment on mouseenter generateLegend Chartjs 2
- How to iterate over array elements inside objects in javascript
- Problem in passing values using props in react.js while using chart.js
- ChartJS hover tooltip colors not showing their correct color
- React: How to get loading spinner to show whilst API data loads into my chart.js chart
- Position tooltip in center of bar
- How to set chartJs Doughnut labels on right side?
- Chart.js, Javascript, unable to sum a data set. Javascript return NaN and I am not sure why
- Javascript array not initialized
- chartjs angular update order
- Embed <canvas> tag in Laravel Markdown?
- Chart.js - displaying multiple line charts using multiple labels
- How to change format of DateTime reading into chart.js chart?