Makanz/chartjs-plugin-trendline

Refreshing Data doesnt recal Trendline?

Closed this issue · 1 comments

wopag commented

Plugin works fine on drawing using the standard "config" but Im updating the chart data set after the initial draw

for (var index = 0; index < 12; ++index) {
window.myLine.data.datasets[0].data[index] = newdata[index+12];
}
window.myLine.update();

But the trendline disappears? - Ive done some tracing and the data is entering the plugin - but hte Y scale always comes out as a negative - so I presume its drawing off canvas?

wopag commented

Sorted.
newdata[index+12] --- is actually a string - which updates jschart ok but not the plugin.

Fixed with a parseFloat( newdata[index+12] )