javascript - Plot always starts at 0, highstock spline chart -
i have data this
var data = []; for(var i=1;i<201;i++){ data.push([i,(math.random() * (80 - 40 + 1)) + 40]) } and i'm creating chart this:
$('.reactivitycont').highcharts('stockchart', { chart: { margintop: 140 }, credits: { enabled: false }, rangeselector : { selected : 1 }, scrollbar: { enabled: false }, navigator: { top : 40, xaxis: { labels: { formatter: function() { return this.value; } } } }, xaxis: { labels: { y: 50, formatter: function() { return this.value; } }, events: { setextremes: function (e) { start = parseint(e.min); koniec = parseint(e.max); $('.nt').hide(); for(var = start-1;i<koniec;i++){ $('.nt').eq(i).show(); } main(); } } }, series : [{ type: 'column', name : 'reactivity', data : data, showinlegend: false, tooltip: { valuedecimals: 2 } }, {type: 'spline', name: 'experiment 1', data: data2, color: 'green', visible: false, tooltip: { valuedecimals: 2 } }, {type: 'spline', name: 'experiment 2', data: data3, color: 'red', visible: false, tooltip: { valuedecimals: 2 } } ], legend :{ enabled: true, margin: 0 }, rangeselector : { buttons: [ { type: 'millisecond', count: seqlength/5, text: '0.25' }, { type: 'millisecond', count: seqlength/3, text: '0.3' }, { type: 'millisecond', count: seqlength/2, text: '0.5' }, { type: 'all', text: '1.0' } ], inputenabled: false, // supports days selected : 4 // } }); but unfortunately, plot starts 0, should not, because there no such value. tried fix it, e. g. setting plotoptions:pointstart didn't work.
this caused using column type series, columns starts 0. prevent set threshold: null, this:
series : [{ type: 'column', threshold: null, ... }]
Comments
Post a Comment