Hi,
I want the user to interactively change attributes of my chart.
Performing changes on the plot
(e.g. XYScatterProfilePanel.this.chart.getXYPlot().setDomainGridlinesVisible(showDomainGrids) shows the change automatically (as expected).
Now, to perform changes on properties belonging to the renderer (e.g. if the shapes of my XYPlot are to be drawn or not), I say
((StandardXYItemRenderer)XYScatterProfilePanel.this.chart.getXYPlot().getRenderer()).setPlotShapes(showPoints);
Why doesn't this call result in an automatic update of my chart so that the changes can be seen at once (although setPlotShapes fires a PropertyChangeEvent)?
Martin
change of renderer properties and automatic repaint in 0.0.6
Re: change of renderer properties and automatic repaint in 0
Sorry, of course I wanted to say "0.9.6" in the subject
Re: change of renderer properties and automatic repaint in 0
Hi Martin!
Try:
StandardXYItemRenderer xyrenderer =
((StandardXYItemRenderer).getXYPlot().getRenderer()).setPlotShapes(showPoints);
XYScatterProfilePanel.this.chart.getChart().getXYPlot().setRenderer(xyrenderer);
Eduardo
Try:
StandardXYItemRenderer xyrenderer =
((StandardXYItemRenderer).getXYPlot().getRenderer()).setPlotShapes(showPoints);
XYScatterProfilePanel.this.chart.getChart().getXYPlot().setRenderer(xyrenderer);
Eduardo
Re: change of renderer properties [...] does not work
Hi Eduardo,
thanks for your quick answer.
So here is what I tried:
StandardXYItemRenderer xyRenderer = (StandardXYItemRenderer)XYScatterProfilePanel.this.chart.getXYPlot().getRenderer();
xyRenderer.setPlotShapes(showPoints);
XYScatterProfilePanel.this.chart.getXYPlot().setRenderer(xyRenderer);
Unfortunately, it does not work - the xyRenderer is still a reference to the same old XYRenderer object, so setRenderer() does not create PlotChangeEvent.
But anyway, I thought that setPlotShapes() would have to do the update without extra work (like method calls on the plot do), or am I wrong here?
It does not seem logical to me that I have to create a PlotChangeEvent on my own. Am I missing something?
Martin
thanks for your quick answer.
So here is what I tried:
StandardXYItemRenderer xyRenderer = (StandardXYItemRenderer)XYScatterProfilePanel.this.chart.getXYPlot().getRenderer();
xyRenderer.setPlotShapes(showPoints);
XYScatterProfilePanel.this.chart.getXYPlot().setRenderer(xyRenderer);
Unfortunately, it does not work - the xyRenderer is still a reference to the same old XYRenderer object, so setRenderer() does not create PlotChangeEvent.
But anyway, I thought that setPlotShapes() would have to do the update without extra work (like method calls on the plot do), or am I wrong here?
It does not seem logical to me that I have to create a PlotChangeEvent on my own. Am I missing something?
Martin