#20 Axes Tick Label orientation parameter doen't work

open
nobody
None
5
2006-01-25
2006-01-25
Marco
No

The labels of the 'Axes Tick Label' are always
displayed orizontally, even if the orientation is set
to values different from 0.
I'm trying version 1.5 of JPivot with JFreeChart 1.0.0.

I've tracked the bug to class ChartComponent, line 514-521:

CategoryLabelPositions newp = new
CategoryLabelPositions(
oldp.getLabelPosition(RectangleEdge.TOP),
new CategoryLabelPosition(
RectangleAnchor.TOP, TextBlockAnchor.TOP_RIGHT,
TextAnchor.TOP_RIGHT, 0.0D,
CategoryLabelWidthType.RANGE, (new
Float(angle)).floatValue()),
oldp.getLabelPosition(RectangleEdge.LEFT),
oldp.getLabelPosition(RectangleEdge.RIGHT)
);

Line 518: the 'angle' variable is passed to the wrong
parameter and 0.0D is passed to label orientation.
This should be:

CategoryLabelPositions newp = new
CategoryLabelPositions(
oldp.getLabelPosition(RectangleEdge.TOP),
new CategoryLabelPosition(
RectangleAnchor.TOP, TextBlockAnchor.TOP_RIGHT,
TextAnchor.TOP_RIGHT, angle,
CategoryLabelWidthType.RANGE, 0.0f),
oldp.getLabelPosition(RectangleEdge.LEFT),
oldp.getLabelPosition(RectangleEdge.RIGHT)
);

Please double check the last parameter, I'm not sure
it's the correct value to pass.

Regards
Marco

Discussion

  • Logged In: YES
    user_id=1399369

    Hi! I also found the same bug. I test the solution posted
    here and it seems to work. Please check it!
    Thaks
    Juan