I have a Shield UI JavaScript Chart on a web page. My aim is to be able to refresh the chart by pressing a button, which works, and to apply some settings based on user’s choice. For that purpose I have a select menu, from which a color for the data series can be chosen:
<select id="seriescolor">
<option value="red"> Red </option>
<option value="green"> Green </option>
<option value="blue"> Blue </option>
</select>
In addition I placed the following code in my refresh function:
seriesSettings: {
line: {
applyAnimation: {
duration: 0
},
pointMark: {
enabled: false
},
if (document.getElementById("seriescolor").value=='red'){
color: 'green',
},
if (document.getElementById("seriescolor").value=='green'){
color: 'green',
},
if (document.getElementById("seriescolor").value=='blue'){
color: 'green',
},
}
},