What I want to do seems simple enough. I have a VectorRenderer that presents vectors.
Some are on top of others. The purpose would be to place a certain series that is hidden
behind other series and bring them to the top. I've rebuilt the dataset after first acquiring
the desired series inserted first (recorder 0) followed by all remaining series. However, attributes
do not appear to be inherited into the new dataset/series like visibility and series color/paint.
So for an example, I want series (id) say 10 to be pushed to the top (id=0) and bubble down
all others where current id=0 would become id=1. Again, rebuilding the dataset works but
attributes are not set when doing this.
Code: Select all
String series2Set = "test";
VectorSeriesCollection newDataSet = new VectorSeriesCollection();
VectorSeriesCollection theDataset; // comes from retained VectorXYDataset
for (int i=0; i < theDataSet..getSeriesCount(); i++){
VectorSeries nextSeries = theDataSet.getSeries(i);
String nextSeriesName = theDataSet.getSeries(i).getkey().toString();
if (nextSeriesName.equals(series2Set){
newDataSet.addSeries(nextSeries);
break;
}
}
for (int i=0; i < theDataSet..getSeriesCount(); i++){
VectorSeries nextSeries = theDataSet.getSeries(i);
String nextSeriesName = theDataSet.getSeries(i).getkey().toString();
if (!nextSeriesName.equals(series2Set){
newDataSet.addSeries(nextSeries);
}
}
...
Iterate through first removing theDataSet (series), then iterate
through the newDataSet, adding each series to theDataSet series.
were on in theDataSet are now off in the newDataSet. Not to mention the series color
are not the same.
Is there any easier way to just re-order which series goes to zero in the series without the
rebuilding of the dataset?
Regards,
Fred