Color chart series based on another series value [message #1784607] |
Fri, 30 March 2018 08:53 |
Carutasu Alexandru Messages: 1 Registered: March 2018 |
Junior Member |
|
|
Hello guys.
Currently I am using a script to color a bar chart with a single Y series based on that series value. Out client want to keep the value there ( is a bar between 0 and 100%) but color it by another criteria. In these way he will see the actual value and,based on the colo, another value.
Right now I am coloring just one axe using these script. Can you help me to achieve these request, please. Thank you !
function beforeDrawDataPoint( dataPointHints, fill, scriptContext){
val = dataPointHints.getOrthogonalValue();
chart = scriptContext.getChartInstance();
if (val < 10)
fill.set(220, 51, 24); //yes - display in red
else
if (val >= 10 && val < 20)
fill.set(213, 75, 24);
else
if (val >= 20 && val < 30)
fill.set(207, 95, 24);
else
if (val >= 30 && val < 40)
fill.set(201, 115, 24);
else
if (val >= 40 && val < 50)
fill.set(195, 133, 24);
else
if (val >= 50 && val < 60)
fill.set(189, 150, 24);
else
if (val >= 60 && val < 70)
fill.set(175, 177, 24);
else
if (val >= 70 && val < 80)
fill.set(151, 171, 24);
else
if (val >= 80 && val < 90)
fill.set(87, 153, 24);
else
fill.set(36, 135, 23); //no - display in GREEN
}
|
|
|
Powered by
FUDForum. Page generated in 0.02865 seconds