horizontal bar chart

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

horizontal bar chart

Post by Oliver Horvath » Fri Jan 05, 2001 6:01 pm

Hi,

I habe a border arround my horizontal bar chart (gray) and the colors
of my grid paint is white. everything looks good, but there is a problem at 0. the grid line covers the border line, that is why
the border line looks white.
Is there a chance to move the 0 point a little bit to the right site,
so that the grid line doesn´t covers the border line? Or any other
solution to solve the problem?

Is there the posibility to give each site of the border around the chart (not arround the panel) an other color?
Where is the border defined?

Have a nice weekend.

Regards,
O. Horvath

David Gilbert

RE: horizontal bar chart

Post by David Gilbert » Wed Jan 10, 2001 11:46 pm

Hi Oliver,

I've registered this as a bug on SourceForge (number 128345) so I don't forget it.

The code that draws the grid lines is in VerticalNumberAxis.java and HorizontalNumberAxis.java (in the draw() method for each class). I think adding 1 to the start point and subtracting 1 from the end point on each line should fix the problem.

One thing to consider - because JFreeChart uses Java2D, all drawing is done in User Space...Java2D then transforms all coordinates into Device Space before actually drawing anything to the screen (or printer or whatever). Adding 1 unit in User Space won't necessarily add 1 unit in Device Space, so there could be situations where the above fix wouldn't work.

Anyone have any suggestions for alternatives?

Regards,

DG.

Locked