Author |
Topic  |
|
johnbutler
23 Posts |
Posted - 10 Nov 2005 : 07:43:52
|
Is it possible to have different sections of the same series colored differently? |
|
quinncurtis
1164 Posts |
Posted - 10 Nov 2005 : 10:04:05
|
That is discussed in the QCChart2DJavaManual.pdf documentation for the SimpleLinePlot class, method setSegmentAttrbiutes. |
 |
|
johnbutler
23 Posts |
Posted - 10 Nov 2005 : 14:00:07
|
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 |
 |
|
quinncurtis
1164 Posts |
Posted - 10 Nov 2005 : 14:48:17
|
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()); |
 |
|
quinncurtis
1164 Posts |
Posted - 10 Nov 2005 : 16:16:08
|
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. |
 |
|
johnbutler
23 Posts |
Posted - 11 Nov 2005 : 07:35:56
|
Good to know. Thanks. |
 |
|
|
Topic  |
|
|
|