Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.5.1 PeriodAxis.draw() does not honor axis.isVisible() #198

Closed
markus-olbrich opened this issue Dec 14, 2020 · 1 comment
Closed

1.5.1 PeriodAxis.draw() does not honor axis.isVisible() #198

markus-olbrich opened this issue Dec 14, 2020 · 1 comment

Comments

@markus-olbrich
Copy link

markus-olbrich commented Dec 14, 2020

PeriodAxis.setVisible(false) will not hide the axis, but reduces axis space.

This can be shown in the Demo Example by
/* --------------------

  • PeriodAxisDemo1.java

  • (C) Copyright 2004-2011, by Object Refinery Limited.

*/

Adding a block of code from DateAxis.draw() Method would solve this.

{code}

@Override
public AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea,
        Rectangle2D dataArea, RectangleEdge edge,
        PlotRenderingInfo plotState) {

	
	// copied from DateAxis  ...
	
    // if the axis is not visible, don't draw it...
    if (!isVisible()) {
        AxisState state = new AxisState(cursor);
        // even though the axis is not visible, we need to refresh ticks in
        // case the grid is being drawn...
        List ticks = refreshTicks(g2, state, dataArea, edge);
        state.setTicks(ticks);
        return state;
    }

{code}

1
2

@jfree
Copy link
Owner

jfree commented Dec 19, 2020

Thanks for the report. It's funny how these bugs can lie hidden for so long. It is fixed for the upcoming 1.5.2 release.

@jfree jfree closed this as completed Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants