You need to sign in to do that
Don't have an account?
Josip Juric87
Lightning component re-create canvas element
I have the following situation:
There is a lightning component which shows a canvas html-element, and is used to render a chart. For some reason (which I will not explain here), when I want to redraw the chart, I need to:
1) destroy the existing canvas element,
and
2) create a new canvas element instead.
How can I do this with Lightning Components? Do I need to use the LC Renderer ?
There is a lightning component which shows a canvas html-element, and is used to render a chart. For some reason (which I will not explain here), when I want to redraw the chart, I need to:
1) destroy the existing canvas element,
and
2) create a new canvas element instead.
How can I do this with Lightning Components? Do I need to use the LC Renderer ?
1) Create a new canvas element using the $A.createComponent method
2) Remove the old canvas and add the new canvas to the container element, by setting it's v.body property
Here's the code: