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

Toggling showLine only adds the line and does not remove it fully #11333

Closed
stephanie-eng opened this issue Jun 8, 2023 · 0 comments · Fixed by #11334
Closed

Toggling showLine only adds the line and does not remove it fully #11333

stephanie-eng opened this issue Jun 8, 2023 · 0 comments · Fixed by #11334

Comments

@stephanie-eng
Copy link

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:

  1. Load the example.
  2. Notice that there is a scatterplot with three pre-existing points, connected by lines. The status of options.showLine is displayed beside the buttons.
  3. 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
  4. 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
      image
  5. Click the Toggle Line button, and observe that lines have reappeared between all data points, as expected. The status of options.showLine is true.
  6. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants