0

I'm moving Chart.js from version 1.x to 2.0.x and I'm stuck at this problem.

As you can see in the image below, I'm trying to display some value distributed over age brackets. At the moment there is no data, but I still want the chart to be displayed. The value that I'm willing to display will be positive integer, so the chart displayed is misleading.

enter image description here

example json:

{ "labels":[ "18-24", "25-34", "35-44", "45-54", "55-64", "65+" ], "datasets":[ { "label":"example 1", "data":[] } ] } 

My question is, how can I set minimal bar value to be at 0?

1 Answer 1

1

well, ok, this was less obvious solution than I could find for ver. 1.0.x

but anyway, here's the options JSON that helped me

 chart = new Chart(ctx, { type: 'bar', data: data, options: { scales: { yAxes: [{ ticks: { suggestedMin: 0 } }] } } }); 

and that I found under: http://www.chartjs.org/docs/#scales

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.