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

myChart.options.elements.point.radius = 5; then chart.update() #10418

Closed
heavyStuff3000 opened this issue Jun 11, 2022 · 4 comments · Fixed by #10451
Closed

myChart.options.elements.point.radius = 5; then chart.update() #10418

heavyStuff3000 opened this issue Jun 11, 2022 · 4 comments · Fixed by #10451

Comments

@heavyStuff3000
Copy link

Expected behavior

when I call myChart.options.elements.point.radius = 5; to shrink a point on the chart and then I call chart.update() the points are supposed to shrink, but they don't really do it. I need to put my cursor on the point, and only then it will shrink.

Current behavior

I created a chart with points sizes of 9, But later, I want to shrink the points to 5(or even hide some with a radius of 0).

When I try to shrink them I do this:

myChart.options.elements.point.radius = 5; myChart.update();

And it is half working, since the points appear at their 'new' sizes, but ONLY AFTER you hover them with your cursor.
Here is a pic to be more clear: https://photos.app.goo.gl/N7JJQvaVu6qSnGUB8

Reproducible sample

https://codepen.io/djaeofkao/pen/mdXQxoE

Optional extra steps/info to reproduce

No response

Possible solution

Respect to all the chart.js devs community you can't believe how helpful this charting library is for me! For now I can only dream to be smart enough to contribute, so respect for all the kinds genius minds working on the project.

Context

I need to shrink the points If I put more data in the chart, and even if possible I would like to delete some of them big giving them a radius of 0

chart.js version

3.7.0

Browser name and version

Chrome Version 102.0.5005.63

Link to your project

No response

@kurkle
Copy link
Member

kurkle commented Jun 11, 2022

You could just handle it in the original function too:
https://codepen.io/kurkle/pen/JjpevGj?editors=1010

Anyway, it looks like there is an issue switching from scriptable to primitive value.

@heavyStuff3000
Copy link
Author

Thank you so much for your contributions. Also didn't expect this to get someone attention in less than 10 minutes!

@heavyStuff3000
Copy link
Author

You could just handle it in the original function too: https://codepen.io/kurkle/pen/JjpevGj?editors=1010

Anyway, it looks like there is an issue switching from scriptable to primitive value.

As a thanks you need to listen to that, i'm pretty sure thoses who made this are on the same level as you are about programming: https://www.youtube.com/watch?v=Ted2nlBSSRU&ab_channel=dancewiththedead

But anyway, do I close this? First time on gitHub. Many thanks again for everything

@etimberg
Copy link
Member

But anyway, do I close this?

No, we should keep this open so that we can fix the underlying issue when switching from a scriptable value to a primitive

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.

3 participants