Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart2D for Java
 Multiple colors in same series
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

johnbutler

23 Posts

Posted - 10 Nov 2005 :  07:43:52  Show Profile  Reply with Quote
Is it possible to have different sections of the same series colored differently?

quinncurtis

1164 Posts

Posted - 10 Nov 2005 :  10:04:05  Show Profile  Reply with Quote
That is discussed in the QCChart2DJavaManual.pdf documentation for the SimpleLinePlot class, method setSegmentAttrbiutes.
Go to Top of Page

johnbutler

23 Posts

Posted - 10 Nov 2005 :  14:00:07  Show Profile  Reply with Quote
Can this be done dynamically? Whenever I attempt to update the segment attributes after the plot has been added to the chartView, the change does not show up. What I am confused by, it that if I change the segment attribute of the first (and only) point before adding the plot to the chartView and then extend the line without copying the segmentAttribute, the first segment attribute is applied to the entire line. However, if I attempt to make any changes after the plot has been added, I don't see them.

Here is what I have...

constructor...

_lineplots[i] = new SimpleLinePlot(_pTransform1, _datasets[i],
SIGNAL_BELOW_THRESHOLD_ATTRIBUTE);
_lineplots[i].setSegmentAttributesMode(true);
_lineplots[i].setSegmentAttributes(0, SIGNAL_BELOW_THRESHOLD_ATTRIBUTE);
this.addChartObject(_lineplots[i]);



updateMethod (called every 1 second).... This method extends all the plots using the previous data value and segmentAttributes.

for (int i=0; i<_numDatasets; i++) {
_datasets[i].addDataPoint(_seriesFrequency[i], time)
_lineplots[i].setSegmentAttributes(_datasets[i].getNumberDatapoints()-1,

_lineplots[i].getSegmentAttributes(_datasets[i].getNumberDatapoints()-2));
}

change attribute method...
_lineplots[seriesNum].setSegmentAttributes(_datasets[seriesNum].getNumberDatapoints()-1,
att);

Edited by - johnbutler on 10 Nov 2005 14:02:05
Go to Top of Page

quinncurtis

1164 Posts

Posted - 10 Nov 2005 :  14:48:17  Show Profile  Reply with Quote
If you are dynamically increasing the size of a dataset, you will also need to dynamically increase the size of the segment attribute buffer.

The ChartPlot.resizeSegmentAttributes method should be called each time you increase the number of datapoints in the dataset.

Dataset1.addDataPoint(101, 75);
thePlot1.resizeSegmentAttributes(Dataset1.getNumberDatapoints());
Go to Top of Page

quinncurtis

1164 Posts

Posted - 10 Nov 2005 :  16:16:08  Show Profile  Reply with Quote
You may want to know that if you use segment colors for a line plot, it will slow the drawing speed up to x100. Segment colors force the software to set the line style and color attributes, and plot every line segment, individually, instead of being able to plot the line plot as one long polyline with a fixed color and line style.

The same applies to marking invalid data points in the dataset attached to the line plot. Anything that breaks up long polyline runs will drastically slow drawing of the line plots.
Go to Top of Page

johnbutler

23 Posts

Posted - 11 Nov 2005 :  07:35:56  Show Profile  Reply with Quote
Good to know. Thanks.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07