You must be logged in to post your query.
Home › Forums › Chart Support › color Variables for dataSeries
Tagged: color, Dataseries
I want the colors inside the chart to be based on the colors created in my root and I value it with var(–bg-root1) but it doesn’t work. Please help me.
JSFiddle
@shiva002,
The color property accepts RGB, hex-code, and color-names as of now. However, you can get CSS variable value in JavaScript using getComputedStyle() as shown in the code snippet below.
function getCSSVarValue(name) { return getComputedStyle(document.getElementById('chartContainer')).getPropertyValue(name); }
Please check this JSFiddle for a working example. __ Rohith Nagaral Team CanvasJS
You must be logged in to reply to this topic. Login/Register