Draw some Series as just lines and some as symbols in XYPlot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Rodney
Posts: 20
Joined: Mon Jun 02, 2003 4:17 am
Location: Adelaide, Australia

Draw some Series as just lines and some as symbols in XYPlot

Post by Rodney » Fri May 14, 2004 6:13 am

Is there a was to plot some series as just a lines (no symbols) and other series as just symbols (no lines joining the symbols) in the same dataset?

nicky
Posts: 44
Joined: Mon Apr 05, 2004 1:45 am
Location: Brisbane, Australia

Post by nicky » Fri May 14, 2004 6:44 am

I used the renderer XYLineAndShapeRenderer and they have the method setSeriesLinesVisible(int series, boolean visible) and the method setSeriesShapesVisible(int series, boolean visible) . I'm presuming most of the other renderers would have something similar.

Nicky

Rodney
Posts: 20
Joined: Mon Jun 02, 2003 4:17 am
Location: Adelaide, Australia

Post by Rodney » Fri May 14, 2004 6:57 am

Cool! Thanks nicky, I'll give that a shot..

Rodney
Posts: 20
Joined: Mon Jun 02, 2003 4:17 am
Location: Adelaide, Australia

Post by Rodney » Fri Jun 04, 2004 5:54 am

Why doesn't the following the code fall inside the loop?

XYItemRenderer r = plot.getRenderer();
if (r instanceof XYLineAndShapeRenderer) {
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;

It works if I replace XYLineAndShapeRenderer with StandardXYItemRenderer (as in the developers guide), but they both implement XYItemRenderer, so I don't see what the difference is.

Any help would be greatly appreciated.

Locked