Can I show an additional line on a jqplot without having to redraw what has already been drawn?

136 views
Skip to first unread message

Terry Liittschwager

unread,
Jun 19, 2012, 10:36:18 PM6/19/12
to jqplot...@googlegroups.com
First, please ignore the previous post that I messed up and couldn't figure out how to edit or delete.

What I need to do is draw a plot starting with a few basic lines and then respond to keyboard input from the user (actually weights to be loaded onto a 747 freighter). Each weight will result in another line. At the end there may be as many as 80+ lines, and I'm hoping to avoid the overhead of having to redraw the previous lines each time a weight is added.

I experimented with jquery flot, bit it appears that it has to redraw each time. I saw a Google item that appeared to say that jqPlot doesn't have to redraw, but I've been unable to figure it out. I can get multiple lines up by modifying the plot with each additional line and using replot(), but that looks like it's redrawing. I can put two plots overlapping (I can see it happening by looking at the different x-ais merging), but the background of the 2nd plot obscures the first. I'm trying to figure out if I can make the backgrounds transparent, but I haven't been able to figure that out yet.

Any ideas will be greatly appreciated.

I'm a newbie at this and Javascript as well. What I'm attempting can be seen at terryliittschwager.com/WB/JWB.php, the first plot down which at the moment is unlabeled and done using flot (as are the subsequent plots). The whole problem right now is that with each weight entry everything has to be redrawn.

Thank you for your help and your patience!

Siddhartha Chinthapally

unread,
Dec 30, 2013, 7:10:42 AM12/30/13
to jqplot...@googlegroups.com
jqplot has a way to "redraw" either one or all _existing_ series. What you need is probably the ability to add a new series on the fly without redrawing the previous ones. AFAIK, this is not there currently. 

jqplot internally uses Series objects (not exposed outside), if you can expose the Series function (by modifying jqplot source code) then you could try the following:
 
Add the series and data to the internal jqplot objects and call drawSeries. This will not redraw the previous lines.

plot.series.push(new Series(seriesConfig));
plot.data.push(seriesData);
plot.drawSeries(seriesIndex);

dan savage

unread,
Apr 22, 2015, 1:19:59 PM4/22/15
to jqplot...@googlegroups.com
Is there an example of this with working code somewhere. I'm confused about how to add a new Series and add the series data steps.
Reply all
Reply to author
Forward
0 new messages