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

Appearing of redundant chart axes #666

Open
kromar777 opened this issue May 1, 2024 · 1 comment
Open

Appearing of redundant chart axes #666

kromar777 opened this issue May 1, 2024 · 1 comment

Comments

@kromar777
Copy link

kromar777 commented May 1, 2024

In one of my apps a user can dynamically add/remove/edit axes and renderers can have as independent as well as "shared" axes (usually only Y as secondary).
I create separate renderers for each dataset and before doing this I always remove chart axes: chart.getAxes().clear(). Also I follow the recommendation in the examples: N.B. it's important to set secondary axis on the 2nd renderer before adding the renderer to the chart. After that I don't touch the chart until adding datasets, but sometimes extra axes are still present:
2024-05-01_09-37-41
I don't get it in what moment they are added again.
I'm not sure whether it's a bug and not a big deal actualy though I would like to get advice how to reliable get rid of chart axes besides of inserting chart.getAxes().clear() in different places along the code where they can appear.

@ennerf
Copy link
Collaborator

ennerf commented May 27, 2024

The mechanism to keep track of axes should be refactored a bit, but so far it has been a low priority.

I assume that this is caused caused by some call to e.g. chart::getXAxis that automatically adds an axis if the chart does not already have one defined (maybe by the gridRenderer?). To fix it, the chart axes should be explicitly specified rather than being cleared, e.g., chart.getAxes().setAll(xAxis, yAxis, xAxis2, yAxis2).

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