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

Custom scale on line graph doesn't start at origin

Open jemenake opened this issue 13 years ago • 4 comments

When I use a line graph with:

var lineChartOptions = {
   scaleOverride   : true,
   scaleSteps      : 10,
   scaleStepWidth  : 20,
   scaleStartValue : 0
}

The "0" is placed where "20" should go, and the "20" is placed where the "40" should go.... on up to 180. The scale should be from 0 (at the lower-left corner) up to 200. And, of course, the scale labels don't line up with the graphs of the data. For example, a dataset looking like:

data : [ 100, 100, 100, ... ]

will line up with label "80"

jemenake avatar Mar 21 '13 19:03 jemenake

:+1: I have also encountered this issue. On a related note, when you have a line chart where all of the data values are the same you won't see anything unless you do a scaleOverride=true but then you run into this issue.

callado4 avatar Mar 22 '13 18:03 callado4

+1 on this issue.

chenzihui avatar Mar 24 '13 14:03 chenzihui

Just submitted a pull request with a patch: #53

ulrichsg avatar Mar 24 '13 17:03 ulrichsg

Thanks for reporting - has been fixed in the latest update with version bump to 0.2

nnnick avatar Apr 12 '13 20:04 nnnick