getting rangeMarker position

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
cee_time
Posts: 8
Joined: Thu Oct 06, 2016 10:23 pm
antibot: No, of course not.

getting rangeMarker position

Post by cee_time » Wed Oct 19, 2016 5:00 pm

It´s possible to get the height value from a valuemarker?

for example if i had a chart region of 240x90

i need to know the height value of that 90 where the valuemarker is. the question is why?

because i need to put the valuemarker label outside the plot area (to the right) to prevent overlaping the label with the bar values.

here´s some image example.

Image

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: getting rangeMarker position

Post by paradoxoff » Wed Oct 19, 2016 6:13 pm

It can be difficult to get this value, depending on from which context you need it.
Some time ago, I have written some annotation classes that cana be used as marker replacements. Here is a link to a thread describing these classes. Click.
I just had a look at the zip file on sourceforge and noted that a CategoryRangeValueAnnotation is missing, but it should be straightforward to write it.
Then, you should be able to disable the clipping of the Graphics2D (which is a prerequisite to draw outside the data area), calculate the position, and finally draw the label using the already existing concepts in the classes.

Locked