IntervalMarker doesn't paint the whole interval

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

IntervalMarker doesn't paint the whole interval

Post by Parveen Kumar » Fri Jan 10, 2003 5:48 pm

Anybody faced the problem that if you use IntervalMarker to paint a region along the Horizontal or vertical axis then jfreechart-0.9.4 library just draws a line in the centre of the interval. Any idea, what could be going wrong.

Following is the code snippet.

plot.addRangeMarker(new IntervalMarker(7,
8,
"x ",
Color.red,
new BasicStroke(15f,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND),
Color.red,
0.2f));

Thanks,

David Gilbert

Re: IntervalMarker doesn't paint the whole interval

Post by David Gilbert » Fri Jan 10, 2003 9:46 pm

The IntervalMarker class got created for the HorizontalMarkerAxisBand, which gets used in HorizontalBarChartDemo2.java. It makes sense that you should also be able to use it in the domain and range markers, but the code hasn't been written to recognise that special case yet. I'll add it to the to-do list...

Regards,

Dave Gilbert

Parveen Kumar

Re: IntervalMarker doesn't paint the whole interval

Post by Parveen Kumar » Fri Jan 10, 2003 10:31 pm

Thanks.

I'd like to share that how I could workaround to this problem. I filled the whole interval with enough single lines that it gives the effect of colored region, only problem is that it slows down the things. I used next() method in TimePeriod class to identify next adjacent point on the DateAxis. But I couldn't add label :(, though if annotations would have worked then my problem could got have solved more.

I'll post if I got some more better solution.

Regards,

Locked