I am in the process of developing dynamically Slope & Flat Chart using JQplot for Bus Time Table.
According to my requirement, apart from the plotted chart I want to plot some dotted lines on the graph. For this I am using horizontalLine, verticalLine and line of canvasOverlay statically.
I want to draw these lines dynamically. The number of lines and all the required points will come from an xml file itself respectively.
As per my understanding the canvasOverlay is taking horizontalLine, verticalLine and line as array objects with some properties. I want to pass these objects from dynamically created array, but I am not able to achieve these lines.
Any solutions to my queries are highly appreciated.
I am in the process of developing dynamically Slope & Flat Chart using JQplot
Share
Here’s a fiddle to explain how draw a line with
canvasOverlay:With interesting code of “line” creation :
The idea would be to add a “line” section and call the
plot.replot();method to redraw the graph.You could populate an array with your line points like this :