How to make square shape point in step chart for a value

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
reach2kanchan
Posts: 32
Joined: Wed Jan 07, 2009 5:09 am

How to make square shape point in step chart for a value

Post by reach2kanchan » Thu Jul 16, 2009 9:00 am

Hi,
I have used XYStepRenderer for create the following step chart.

Code: Select all

 XYStepRenderer sxyir = new XYStepRenderer();
Image
I have faced a problem.I want to highlight the point with the square shape whenever i got a value in a specific time.
Suppose in this graph i have got value 9 at 07:19:57 AM and again got 10 at 08:21:47 AM.
Now i need to highlight those points with a square shape point.
please help me by giving suggestion.

Thanks

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

Re: How to make square shape point in step chart for a value

Post by david.gilbert » Thu Jul 16, 2009 9:11 am

There's a few options:

(1) Modify the renderer to display shapes (I didn't write this renderer, but I think it should be easy enough to add shapes back in, because it subclasses XYLineAndShapeRenderer);

(2) Overlay the points by adding a second dataset (a clone of the first) and renderer to the plot.

(3) Use plot annotations to highlight the points (e.g. XYShapeAnnotation).
David Gilbert
JFreeChart Project Leader

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

Locked