LineRenderer

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Guest

LineRenderer

Post by Guest » Wed May 12, 2004 4:46 pm

I have a combined chart. Bar chart and line chart. My line uses square shapes at the points on the graph. I would prefer if they were round and also if they were unfilled. I have tried manipulating the BasicStroke constructor but no combination seems to work.

BasicStroke s2 = new BasicStroke(s.getLineWidth(), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
renderer2.setStroke(s2);

But it doesn't seem to work.
Does anyone know how to make it work?

Thanks

astenwick
Posts: 13
Joined: Tue Apr 13, 2004 8:03 pm
Location: Seattle

Post by astenwick » Wed May 12, 2004 5:28 pm

Make sure you use the XYLineAndShapeRenderer for your line portion of your graph. Set the shape to a circle by using

renderer.setShape(new Ellipse2D.Double(-4, -4, 8, 8));

and then set the shapes to not be filled by using

renderer.setShapesFilled(false);

Hope this helps!

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed May 12, 2004 11:14 pm

If you are using the LineAndShapeRenderer, I'm currently looking at a bug where a lot of code is duplicated between the AbstractRenderer class and the AbstractSeriesRenderer class. This might be causing the problem. I need some time to work through it properly...
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Guest

Post by Guest » Thu May 13, 2004 10:54 am

Thanks astenwick that helped a lot. :D

Locked