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

Vuepress samples config stays in memory #8778

Closed
1 task done
LeeLenaleee opened this issue Apr 2, 2021 · 6 comments · Fixed by #8787
Closed
1 task done

Vuepress samples config stays in memory #8778

LeeLenaleee opened this issue Apr 2, 2021 · 6 comments · Fixed by #8787

Comments

@LeeLenaleee
Copy link
Collaborator

Documentation Is:

  • Confusing

Please Explain in Detail...

With the new vuepress samples, options set with the actions it keeps that in memory for the other charts even though its not in there config which may be confusing,

If you go to: https://www.chartjs.org/docs/master/samples/legend/position.html and place the legend in the bottom and go to an chart where the tooltip location is not specified you will see it apear in the bottom as well like here: https://www.chartjs.org/docs/master/samples/title/alignment.html

Your Proposal for Changes

Only solution I can think of at the moment is to give every chart the default config of things we adjust like legend placement, tooltip placement and mode

@etimberg
Copy link
Member

etimberg commented Apr 2, 2021

@simonbrunel have you seen this before with the editor plugin? My thought is that it's keeping the state and doing updates on page transitions rather than making a new chart.

@LeeLenaleee
Copy link
Collaborator Author

Some extra findings, if you for example take the legend postion and use the button to put it to the right it goes to the right, if you then write the options object to put it to the left it shows left, if you then go to another chart its on the right again so it looks like it keeps the state from the button update only and not from the editing field

@simonbrunel
Copy link
Member

@etimberg I haven't but if I put a breakpoint right after chart.options.plugins.legend.position = 'right'; for the Position: right action and read Chart.defaults.plugins.legend.position, I get 'right'. I don't think it's caused by the editor component but it makes sense that charts on other pages are impacted since the Chart.defaults have changed.

image

@etimberg
Copy link
Member

etimberg commented Apr 2, 2021

Hmmm, I don't know why that would be updating defaults. It should just be changing the local options.

@kurkle
Copy link
Member

kurkle commented Apr 2, 2021

oh right. this is a proxy thing. it writes to the top level scope, which in this case is the defaults.

@etimberg
Copy link
Member

etimberg commented Apr 2, 2021

Is there anyway to configure that? Seems like it should write to the lowest level scope

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.

4 participants