SusanApril 18, 2016 at 12:24 pm #6115
I have been working with the Radial Chart and running into an issue I cannot resolve.
I have multiple charts on the page and the value for the chart will be changing at times, similar to your example but each chart will not be updated with the same value. I would like to put this into an onchange event that I can pass in the Id for the chart and then update it with the new value.
The function properly gets called but instead of updating the existing chart it creates a new chart. I’ve created a Plunker that demonstrates the problem I am running into. https://plnkr.co/edit/g3G8VqZ9M0OP5s94Xk3L?p=preview
I think it is because of the call on line 31 of custom.js. In your example you saved a reference to the charts globally but with the set up I am using that is not possible to do.
Hopefully it is just something small I am over looking. Let me know if you need any more details or have any questions.
~SusanvizulyApril 18, 2016 at 12:34 pm #6116
Thanks for posting your question on the forum. I took a look at what you were doing and made a couple quick fixes:
Basically you were grabbing a DOM reference to “div1” and “div2”, and re-creating the chart each time. The constructor function for any vizuly component like vizuly.component.radial_progress(DOMElement) takes a DOM element in its constructor and returns a reference to the new vizuly variable which contains the chart.
I put in a couple of quick hacks that make it work correctly, but you would probably want to clean up the naming convention (perhaps from div1,div2 to viz1,viz) and put those variables somewhere out of the global namespace where I put them. I just did it this way to minimize the amount of code I had to change.
I hope that helps point you in the right direction.
– TomSusanApril 19, 2016 at 5:28 am #6120
Thank you. That did help me get to a working state for my app. The actual application has some better naming conventions; I just put something quick together to demonstrate the issue.
You must be logged in to reply to this topic.