I have a XYItemRenderer that i have 2 series on. Ultimately, I will have multiple renderers (XYItemRenderer, Vector) but for now I cannot get a
series on this renderer to go invisible. I evaluate the "getItemVisible(series,item)" afterwards to determine if any of the items should be displayed.
The value returned is false but the series/items remain on the chart. I have placed s snibbit of the code below. Its embedded within a keyListener event.
The idea is that a user will click on the related series/item. Hit a hotkey that will issue the calls to make the series invisible.
Code: Select all
seriesVal = Integer.parseInt(items2Change.substring(startP, endP));
System.out.println("datasetVal="+datasetVal+"..seriesVal="+seriesVal);
XYDataset dsVal = plot.getDataset(datasetVal);
System.out.println("dsVal="+dsVal);
//plot.getRendererForDataset(plot.getDataset(datasetVal)).setSeriesVisible(seriesVal, Boolean.FALSE, Boolean.TRUE);
plot.getRenderer().setBaseSeriesVisible(Boolean.FALSE, Boolean.TRUE);
boolean tVisible = plot.getRenderer().getItemVisible(seriesVal, 0);
System.out.println("tVisible="+tVisible);
Thanks