Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart2D for Java
 ChartConstants.rBadDataValue displays temp line

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
johnbutler Posted - 09 Nov 2005 : 09:53:28
I am trying to show breaks in data sets on a dynamic chart. I am using the SimpleDataset class to hold the data. When I set a point's x or y value to ChartConstants.rBadDataValue to make that point not valid, the chart temporarily displays a line off the graph. Is there another way to specify a point as not valid and thereby show a break in the series?
5   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 10 Nov 2005 : 08:33:36
Your example looks wrong. The code that you have will only affect the last point, since the value of numPoints is fixed. We changed it to

    Dataset1.setDataPoint(numPoints-1, 10.0 * numPoints,  20 + 20 * (0.5 - Math.random()));
    Dataset2.setDataPoint(numPoints-1, 10.0 * numPoints, 30 + 15 * (0.5 - Math.random()));
    Dataset3.setDataPoint(numPoints-1, 10.0 * numPoints, 50 + 20 * (0.5 - Math.random()));
    for (i=0; i < numPoints; i++)
    {
      if ((i % 5) == 0)
	    Dataset3.setValidData(i, false);
    }
    Dataset4.setDataPoint(numPoints-1, 10.0 * numPoints, 40 + 20 * (0.5 - Math.random()));


and it showed breaks in the line as we expect.
johnbutler Posted - 10 Nov 2005 : 07:41:58
The multiline example I have is not dynamic and doesn't have an updateChart method. I tried modifying the example dynamiccharts.

I modified MixedPlotDynamic as follows:


int count = 0;
void updateDynGraph()
{ double y[];
int i;
count++;

...
...

Dataset4.setDataPoint(numPoints-1, 10.0 * numPoints, 40 + 20 * (0.5 - Math.random()));

if (count%5 == 0)
//Dataset3.setValidData(numPoints-1, false);
Dataset3.setDataPoint(numPoints-1, 10.0 * numPoints,
ChartConstants.rBadDataValue);


gWG.repaint();
}

I also modified the timer to be 500ms to allow me to see the effect. First, when I used setValidData I did not see a break in the line (series) that I was exepecting. Second, when I used rBadDataValue, the line temporarily flashed up to infinity but then showed the break.
quinncurtis Posted - 09 Nov 2005 : 12:57:02
We cannot reproduce the problem you describe.

See if you can reproduce the problem by modifying one of our example programs, say the MultiLine class in the Multiline example program. That's what we did, updating the graphs dataset incrementally using a timer, marking every 10th data point invalid, and we could not see any of the lines going to zero. The update routine looks like:

void updateChart()
   {  double y[] = new double[numGroups];
    
       int j;
      double x =  (double)count * 0.2;
      for (j = 0; j < numGroups; j++)
         y[j] = (double) 5 * j;

      Dataset1.addGroupDataPoints(x, y);
      if ((count % 10) == 0)
      {
        Dataset1.setValidData(count-1, false);
        gWG.updateDraw();
      }
      count++;
   }
johnbutler Posted - 09 Nov 2005 : 11:10:18
When I do the following, the series line temporarily goes to 0.

datasets[i].addDataPoint(0, time); datasets[i].setValidData(datasets[i].getNumberDatapoints()-1, false);
quinncurtis Posted - 09 Nov 2005 : 10:10:33
Use the datasets setValidData method.

For example, mark the data point an index 23 as bad.

dataset1.setValidData(23, false);

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