draw different shape for point being drawed

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Jorne
Posts: 10
Joined: Fri Mar 18, 2016 2:21 pm
antibot: No, of course not.

draw different shape for point being drawed

Post by Jorne » Thu Apr 21, 2016 3:33 pm

Hi there,

in my chart i'm drawing the same graph all the time going forward and backward all the time. on my x-as the values go from 0-5000 and going back from 5000-0. The chart will draw the line almost identical the entire time.
For me it's important that i can follow where the line is drawing. so what i mean is the first time the line is being drawed i can follow it ofcourse but once the entire graph is drawn i cannot follow it anymore because the line keeps getting "overriden". now i was wondering if it possible to mark the point that is being drawn to be a shape like a rectangle or a crosshair doesn't really matter which shape. but then when a new point is being drawn the previous shape will dissapear.
So basically there should always be only one shape in chart.

Is it possible to accomplish this?

i've tried numerous of posibilities but i can't get it to work

Thanks in advance!

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: draw different shape for point being drawed

Post by John Matthews » Fri Apr 22, 2016 4:42 pm

This example overrides the renderer's getItemShape() method to return a distinct Shape for a specific point. This example overrides the renderer's getItemPaint() method to return a distinct Paint for a specific point.

Jorne
Posts: 10
Joined: Fri Mar 18, 2016 2:21 pm
antibot: No, of course not.

Re: draw different shape for point being drawed

Post by Jorne » Mon Apr 25, 2016 10:40 am

John Matthews wrote:This example overrides the renderer's getItemShape() method to return a distinct Shape for a specific point. This example overrides the renderer's getItemPaint() method to return a distinct Paint for a specific point.
Thanks for the reply. I also found those two examples but it wasn't really what is was looking for. My explanation in the first post might not be as clear as water.
But I already found the solution for my problem. Thanks anyway for the reply!

Locked