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
- colour sets for Chart.js border colour
- How do you revert xAxes with Chart.js?
- Is there a way to hide/customize ChartJS' above legend?
- Error: [$injector:unpr] Unknown provider: chart.jsProvider
- Error in created hook (Promise/async): "TypeError: Cannot read property 'position' of undefined"
- add editable textbox to specific datapoint in a chart
- ChartJS - adding scroll to horizontal legend in Line chart
- How to set data values as labels in Chart.js with a Radar Chart
- Move tooltip further from data point for Chart.js?
- Referencing locally declared variable into an array for data for chartjs
- Removing empty cells (rows) from csv file in javascript
- how to add percentage value to legend field in pie chart using chart.js
- Keep two Pie Charts Side by Side
- chartjs - How to use differente color if value is lower than previous value?
- Using chart.js to output chart as a saved image rather than using canvas
- Using CSS variables (color) with chart.js - "var(--primaryColor)" not working
- How to make a interactive legend with chartjs
- VueJS TypeScript using ChartJS - Parsing error: '}' expected
- Chart js Bar Time Chart
- How can I sort month by order?
- Unable to get Line Chart tooltip on ChartJS
- Date range picker and chart js
- onClick : handleClick
- ChartJS fails to render one of the lines in cartesian chart following update after change to max Y axis label value
- Why isn't my Angular 4 ChartJS component rendering?
- How to display Tooltip without hovering pie chart with Chart.JS
- How do I horizontally center a line chart when their is a single X-Axis value?
- Are we able to position the y axis in the center of the x axis?
- Why doesn't my donut chart, created with Chart.js, appear?
- Chart.js does not display stacked data with linear axis and fixed steps