Javascript displaying adjustable chart on first question, but not subsequent questions? | XM Community
Skip to main content
Hi all,



I have an issue displaying a chart that is drawn in javascript- it works on the first question block, but not in subsequent blocks & questions in preview mode, and via anonymous link. The charts display fine when the questions/ blocks are previewed in isolation within the editor. I've attached the qsf- does anybody have experience with this issue?



Many thanks!
Hi @cjohnburke,



So the issue you are facing here is due to duplicate id's

Adding the following code in addOnUnload function for every question you have the chart code on should solve your problem:



`jQuery("#myChart").remove(); `



Attached the updated qsf i tried the code and charts are working on
Thank you @NiC ! THis worked. The other thing that worked was disabling page transitions in the look and feel editor.

Leave a Reply