i'm trying make y axis divided [0, 250, 500, 750, 1000] exactly. 'divisor' attribute i've set 250 not work , still remains default 200.
<body> <div class="ct-chart ct-perfect-fourth" id="mychart"></div> </body> new chartist.line( '#mychart', { labels: ['week 1', 'week 2', 'week 3', 'week 4', 'week 5'], series: [ [560, 600, 840, 900, 400] ] }, {divisor: 250} ); see full code @ jsfiddle
in order want:
- your jsfiddle using old version of chartistjs (0.7.2), upgrade latest (0.9.1)
- specify type of scale
axisychartist.fixedscaleaxis - define
low,highinaxisy - define ticks (in case
[0, 250, 500, 750, 1000])
the final result should this:
new chartist.line('#mychart', { labels : [ 'week 1', 'week 2', 'week 3', 'week 4', 'week 5' ], series : [ { name : 'one', data : [ 560, 600, 840, 900, 400 ] }, { name : 'two', data : [ 500, 510, 740, 300, 300 ] } ] }, { axisy : { type : chartist.fixedscaleaxis, low : 0, high : 1000, ticks : [ 0, 250, 500, 750, 1000 ] }, });
Comments
Post a Comment