Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart2D for Java
 How do I clear a plot?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
javaman Posted - 30 Oct 2008 : 20:04:59
I have a simpleLinePlot that I would like to clear from a popup menu option. I'd like to remove all the datapoints and start a new graph.

I do the following:

1) Change my dataset to a newly initialized dataset
2) remove the old plot from the chartview
3) add a new simpleLinePlot with the newly formed dataset
4) add the plot to the chartview
5) repaint

This doesn't work - the plot still shows the old data.
Is there a simpler way of doing this?

Thanx. Joe...

Thanx - Joe!
3   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 31 Oct 2008 : 18:08:36
Actually it shouldn't make much of a difference. Everything is going to be redrawn anyway. If you want to re-autoscale and re-autoaxes the chart you might as well just clear it and start over.

But, if you don't want to do it that way, see item #7 in the FAQ section: How do you update charts in real-time?

http://www.quinn-curtis.com/QCChart2DJavaFAQs.htm

There is no need to remove the old line plot. Just create the new dataset, change the dataset of the line plot to the new one. Then call the ChartView updateDraw method. Look at the examples in the DynamicCharts example program.
javaman Posted - 31 Oct 2008 : 16:32:27
That doesn't make sense. I don't want to remove my axes and grid lines. I only want to clear out the datapoints and start the graph over. Is there another method to call that will just clear out the datapoints in the dataset and leave the graph untouched in terms of layout?

Thanx - Joe!
quinncurtis Posted - 30 Oct 2008 : 20:15:50
Call the ChartView ResetChartObjectList method to clear out all of the previously added chart objects. Then add the new stuff.

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07