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

Fixed axis range does not work with inverted axis #383

Closed
ennerf opened this issue Mar 26, 2021 · 2 comments · Fixed by #418
Closed

Fixed axis range does not work with inverted axis #383

ennerf opened this issue Mar 26, 2021 · 2 comments · Fixed by #418
Assignees
Labels

Comments

@ennerf
Copy link
Collaborator

ennerf commented Mar 26, 2021

Version: chart-fx 11.2.5

I'm trying to create a chart with a fixed range on an inverted axis. Creating a non-inverted one works

Chart chart = new XYChart();
Axis xAxis = chart.getFirstAxis(Orientation.HORIZONTAL);
xAxis.setAutoRanging(false);
xAxis.setAutoGrowRanging(false);
xAxis.set(0, 100);

Axis yAxis = chart.getFirstAxis(Orientation.VERTICAL);
yAxis.setAutoRanging(false);
yAxis.setAutoGrowRanging(false);
yAxis.set(0, 10);

image

but as soon as I add inversion, both X and Y axes are fixed to [-1, +1]. It does not matter whether it is only one axis or in which order the methods are called.

xAxis.invertAxis(true);
yAxis.invertAxis(true);

image

RalphSteinhagen added a commit that referenced this issue May 14, 2021
N.B. axis range clearing doesn't seem to be necessary when inverting the axis
* added sample to illustrate use of inverted axes (and also fix)
* added another (unrelated) sample to illustrate plotting of limits
* minor code clean-up (usage of 'var', unavoidable PMD/SONARLINT suppression).
@RalphSteinhagen
Copy link
Member

@ennerf thanks for reporting.

I made a simple MVP sample `SimpleInvertedChartSample.java' to reproduce and fix this issue -- actually by removing a seemingly superfluous 'clear()' when inverting the axis. For the auto-ranged axes, these cleared values are re-written thus the feature you observed.

This seems to solve the issue at least for the above case. Would you be willing to review the PR and check if there are other related corner use-cases? Thanks in advance.

@ennerf
Copy link
Collaborator Author

ennerf commented May 17, 2021

I can't test with my original application, but the examples work 👍

wirew0rm pushed a commit that referenced this issue May 25, 2021
N.B. axis range clearing doesn't seem to be necessary when inverting the axis
* added sample to illustrate use of inverted axes (and also fix)
* added another (unrelated) sample to illustrate plotting of limits
* minor code clean-up (usage of 'var', unavoidable PMD/SONARLINT suppression).
RalphSteinhagen added a commit that referenced this issue Jun 25, 2021
N.B. axis range clearing doesn't seem to be necessary when inverting the axis
* added sample to illustrate use of inverted axes (and also fix)
* added another (unrelated) sample to illustrate plotting of limits
* minor code clean-up (usage of 'var', unavoidable PMD/SONARLINT suppression).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants