Skip to content

Log-scaled axis have wrong minor tick count by default #694

@eltos

Description

@eltos

Describe the bug

By default, log-scaled DefaultNumericAxis have 9 minor ticks where it should have 8. This can be seen in the LogAxisSample.java (screenshot taken from README):

DefaultNumericAxis yAxis = new DefaultNumericAxis();
yAxis.setLogAxis(true);

Image

Log-scaled axis should have 8 minor ticks:

Image

The problem is that minorTickCount defaults to 10 ("The number of actual minor tick marks will be one less than this") irrespective of the lin/log scale setting. See here.

One can work around this by explicitly setting the minorTickCount:

axis.setMinorTickCount(9); // actual number is one less

But ideally, and especially because this is the prime example given in the README, it should have a smarter default (9 or 10) depending on the lin/log setting when not explicitly overwritten by the user.

At the very least (poor-man solution) the example should be updated with the above workaround to point people to this unexpected behaviour.

To Reproduce

Environment:

  • OS: any
  • Java version: any
  • JavaFx version: any
  • ChartFx version: master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions