method for limiting the number of symbols on an XY chart?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
chris36
Posts: 1
Joined: Wed Jan 18, 2006 5:17 pm

method for limiting the number of symbols on an XY chart?

Post by chris36 » Wed Jan 18, 2006 5:35 pm

my xyPlots have many points, and assigning shapes to some of the points would be helpful in identifying each line on a plot. With a shape at each point, it is hard to differentiate each line. With that being said, is there a method out there for limiting the number of shapes on an XY Plot. I do have the documentation, but have not found anything yet.

Chris

jelaiw
Posts: 6
Joined: Sat Jul 05, 2003 8:40 pm

Post by jelaiw » Thu Apr 27, 2006 8:38 pm

chris36,

Any progress on this item? I am in a similar situation (I think) where I generate a dataset using the DatasetUtilities.sampleFunction2D to "simulate" the drawing of curves since there is no direct support for drawing curves (that I am aware of).

It would be helpful to differentiate between the lines.

One way, as you've suggested, is to draw each line with shapes at some points. I haven't figured out an elegant way to do this. I can make it look like this by drawing a line with no shapes, then drawing that same line with only shapes sampled at a few points.

Another way is to use various kinds of dotted and dashed lines by modifying the stroke. This is fine, but I personally would love (a) more direct support for drawing curves and (b) a more elegant way of drawing a line + shape for curves.

Jelai

Carl Manaster
Posts: 35
Joined: Tue Mar 28, 2006 1:10 am
Location: La Jolla
Contact:

Post by Carl Manaster » Thu Apr 27, 2006 8:56 pm

I think to do this you would simply subclass XYLineAndShapeRenderer and have your class call the inherited method for the points you want drawn. Looking over the class, I think it might be simpler to override drawItem() and simply setShapesVisible() or setSeriesShapesVisible() on a per-item basis. Something along those lines should work.

Locked