-
Notifications
You must be signed in to change notification settings - Fork 12k
Description
Expected Behavior
After calling update() on a consistent chart configuration with an additional unused axis I would expect the datasets to be displayed on the correct axes.
Current Behavior
One dataset is displayed on the additional unused axis.
Additionally the 'unused' axis is displayed 'overlayed', but that's not what this bug report is about.
Possible Solution
Steps to Reproduce (for bugs)
Bug can be reproduced with this codepen: https://codepen.io/nas3nmann/pen/XwGLbg?editors=1010
Here are the steps in detail:
- Create time based chart with one dataset and two yAxes (named 'y1' and 'unused'), one not displayed and unused, the other assigned to the dataset via yAxisID
- Add a second dataset without axisID. Call chart update().
- Remove 'y1' axis
- Push new axis configuration for two similar axes 'y1' (again) and 'y2'.
- Assign axes 'y1' to dataset 1 and 'y2' to dataset 2. Call chart update().
- Change "display" property of unused axis to "true"
Context
I was trying to add new data to the chart and refresh the axis configuration while keeping a separate axis for other purposes non visible.
If i remove the chart.update() call after adding the second dataset, it is correctly displayed on axis 'y2'.
I'm doing these updates because i was running into this issue from time to time: #5149
Environment
- Chart.js version: 2.8.0
- Browser name and version: Firefox 60.6.2esr (32-Bit)