Hi,
Is it possible to plot points rather than lines in a XYDataSet ?
And can we choose the shape of the points (squares, circles, triangles...) ?
Thanx
Steph
XYDataSet : Points rather than Lines
Re: XYDataSet : Points rather than Lines
Hi Steph,
You can change the renderer for the XYPlot:
XYPlot plot = myChart.getXYPlot();
XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES);
plot.setRenderer(renderer);
If you want to use custom shapes, you should look at the setShapeFactory method in the Plot class.
Regards,
DG.
You can change the renderer for the XYPlot:
XYPlot plot = myChart.getXYPlot();
XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES);
plot.setRenderer(renderer);
If you want to use custom shapes, you should look at the setShapeFactory method in the Plot class.
Regards,
DG.
Re: XYDataSet : Points rather than Lines
Thanx a lot David,
It works properly.
But I would like to plot several curves in the same chart : one must be a line without shapes and the others must be only shapes.
Is it possible to do that with an XYDataset object ?
Your previous answer works only if I want to set every curves of my chart in the same type.
Thanks
Steph
It works properly.
But I would like to plot several curves in the same chart : one must be a line without shapes and the others must be only shapes.
Is it possible to do that with an XYDataset object ?
Your previous answer works only if I want to set every curves of my chart in the same type.
Thanks
Steph
Re: XYDataSet : Points rather than Lines
At the moment you need to use an OverlaidXYPlot with two (or more) subplots, because the renderer is 'per plot' rather than 'per series'. It might make sense to change that, but I'll have to wait until I've thought about it properly first...
Regards,
DG.
Regards,
DG.
Re: XYDataSet : Points rather than Lines
Ok Thanks a lot
Just a last question :
Is it possible to fill the shapes with a colour (cause every shapes I plot
are empty) ?
Regards
Steph
Just a last question :
Is it possible to fill the shapes with a colour (cause every shapes I plot
are empty) ?
Regards
Steph