Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

[BUG] scales.yAxes.ticks.stepSize ignored?

Open wldkrd1 opened this issue 10 years ago • 5 comments

Expected Behavior

Ticks should start at 0 and increment by stepSize (1 in my case)

Current Behavior

yAxes tick intervals remain at 0.5 ticks

Steps to Reproduce (for bugs)

var chartOptions = { scales: { yAxes: [{ ticks: { beginAtZero: true, stepSize: 1, fixedStepSize:1, min: 0 } }] } };

var myChart = new Chart(ctx, reviewsChartData, chartOptions);

Context

No matter what I put in the options, stepsize remains at 0.5

Environment

  • Chart.js version: 2.4.0
  • Browser name and version: IE11

wldkrd1 avatar Nov 03 '16 21:11 wldkrd1

@wldkrd1 can you drop this test into a fiddle?

etimberg avatar Nov 03 '16 21:11 etimberg

Hmm. Well, stealing someone else's...https://jsfiddle.net/ozbhpw44/4/

wldkrd1 avatar Nov 03 '16 21:11 wldkrd1

So, seems like it's ignoring settings and just using whatever it wants to scale the ticks/gridlines.

wldkrd1 avatar Nov 03 '16 21:11 wldkrd1

Verified this also occurs in version 2.4.0

wldkrd1 avatar Nov 17 '16 17:11 wldkrd1

The problem was that the options were not passed in correctly.

wldkrd1 avatar Nov 18 '16 17:11 wldkrd1