I included jquery.flot.trendline.js
. From Here
It is my code
$.plot($("#placeholder"), seriesdata, {
series: {
trendline: {
show:true,
lineWidth:2,
fill:true,
fillColor:false,
steps:true
},
...
});
I'm not getting trend line in the chart.
That plugin is a no-go. It requires modifications to the flot source to work and in my opinion isn't very well done. The simpliest approach would be to just add the trendline yourself as an additional series. The math is not difficult...
You can then call this as:
And add the lineFitSeries as another series to flot...
Here's a working example.