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.showLine is displayed beside the buttons.
- Click the
Toggle Line button, and observe nothing happens to the plot. The status of options.showLine has changed to false.
- Expected behviour: Lines connecting the points should be removed
- Click the
Add Data button 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.
- Expected behviour: No lines connecting any of the points

- Click the
Toggle Line button, and observe that lines have reappeared between all data points, as expected. The status of options.showLine is true.
- 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
Expected behavior
In the example linked below, we are trying to toggle the line on a scatter chart. When changing
options.showLinetofalse, expected behaviour is that the lines for all points in the chart disappear, and reappear whenoptions.showLineis set totrue. 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:
options.showLineis displayed beside the buttons.Toggle Linebutton, and observe nothing happens to the plot. The status ofoptions.showLinehas changed to false.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.Toggle Linebutton, and observe that lines have reappeared between all data points, as expected. The status ofoptions.showLineistrue.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