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

Missing legend causes uncaught errors when updateing data. #409

Open
echobops opened this issue Apr 7, 2023 · 0 comments
Open

Missing legend causes uncaught errors when updateing data. #409

echobops opened this issue Apr 7, 2023 · 0 comments

Comments

@echobops
Copy link

echobops commented Apr 7, 2023

Expected Behaviour

Replacing data on a bar chart that previusly had 1 data set item, with new data that has 2+ dataset items, the legend should appear and show the data.

Actual Behaviour

Replacing the datasets with 2+ items on a bar chart that only has 1 current dataset item will throw an error in the console and fail to render the chart:

Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'textContent')

This is likely caused by the fact that a single dataset item bar chart does not create a legend. When replacing the data with something that now needs a legend, the code assumes one is present and attempts to set the names on the legend.

Steps to Reproduce:

  • Create a bar chart with a single color, label, and dataset item.
  • Replace the datasets, colors, and labels with correct data represeting 2+ dataset items.

NOTE: Add a GIF/Screenshot if required.

Frappé Charts version: 1.6.2
Codepen / Codesandbox:

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

1 participant