-
Couldn't load subscription status.
- Fork 12k
Closed
Labels
Milestone
Description
Expected behavior
In the example linked below, we are trying to toggle the line on a scatter chart. When changing options.showLine to false, expected behaviour is that the lines for all points in the chart disappear, and reappear when options.showLine is set to true. This should happen for all data points regardless of when they are added to the chart.
See Current behaviour for detailed breakdown.
Current behavior
The following steps illustrates the issue:
- Load the example.
- Notice that there is a scatterplot with three pre-existing points, connected by lines. The status of
options.showLineis displayed beside the buttons. - Click the
Toggle Linebutton, and observe nothing happens to the plot. The status ofoptions.showLinehas changed to false.- Expected behviour: Lines connecting the points should be removed
- Click the
Add Databutton to the chart, and observe new data points to the plot. The new data points do not have a line, but the pre-existing data points still maintain their line. - Click the
Toggle Linebutton, and observe that lines have reappeared between all data points, as expected. The status ofoptions.showLineistrue. - Go to step 3 and repeat.
Reproducible sample
https://codepen.io/kazaaak/pen/ZEmYEam
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
4.3.0
Browser name and version
Chrome, Firefox
Link to your project
No response
