Hi,
I want to embed some different currency charts on my page which depend on the currency codes I have in my current CMS fields. Unfortunately I can't reference the charts using the currency codes directly as I've had to create them myself through highcharts (so they have a mixture of 7 random characters which are not associated with any references in the collection currently).
I wanted to see if there is a way I could do this through conditional IF statements in Javascript/ HTML on the page to build the reference list rather than reuploading the items again. Forgive me if this post seems a little "amateur hour".
There will be over 20 different charts, but as an example, here are 3 different HTML embeded charts I would need to set a reference:
The AUD chart div id = 'uminhun'
The EUR chart div id= 'abydihu'
The USD chart div id = 'ogyhaty'
Could I put some Javascript in the body of the page (I realise the code is not there)
If Currency1 = USD { a = 'ogyhaty'}
else if Curency1 = EUR { a = 'abydihu'}
else if Currency 1 = AUD { a = 'uminhun'}
Could I change the references in the first embed chart to something like:
<div id='highcharts-**(var = a)'**><script src='//cloud.highcharts.com/inject/**(var = a)**' defer='defer'></script></div>
Really appreciate some help with my amateur approach!