Skip to content

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

@markus-olbrich

Description

@markus-olbrich

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions