Home
Designing Analytics Reports
Chart Area : script to change colors
Migrateduser
<p>Hello guys,</p>
<p> </p>
<p>I'm trying to modify an Area chart to color the area depending on treshold.</p>
<p> </p>
<p>The purpose is to have :</p>
<p> green area when value < X </p>
<p> orange area when value > X && < Y</p>
<p> red area when value > Y</p>
<p> </p>
<p>Does anyone have a suggestion on how to modify the color of an area chart, it seems the fill.set is not taken into account.</p>
<p> </p>
<p>Thanks in advance</p>
<p> </p>
<p>I can't manage doing it, I have already tried that : </p>
<pre class="_prettyXprint">
function beforeDrawDataPoint( dph, fill, icsc )
{
var seriesName = dph.getSeriesDisplayValue();
fill.set(136,185,23);
label.getCaption().setColor(136,185,23);
if (dph.getSeriesDisplayValue() == "Avg"){
val = dph.getOrthogonalValue();
if(val > icsc.getExternalContext().getScriptable().getParameterValue("w_threshold")){
if(val < icsc.getExternalContext().getScriptable().getParameterValue("c_threshold")){
fill.set(255,154,219)
}else{
icsc.getExternalContext().getScriptable().evaluate("writeLogServer(\"CRITICAL VALUE\");");
fill.set(224,11,61);
}
}
}
}</pre>
Find more posts tagged with
Comments
There are no comments yet