Hi,<br />
I'm working on a bar chart and I would like to change each bar color depending on the X series label.<br />
I know that I can use the method beforedrawdatapoint :<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
/**
* Called before drawing each datapoint graphical representation or marker.
*
*
@param dph
* DataPointHints
*
@param fill
* Fill
*
@param icsc
* IChartScriptContext
*/
function beforeDrawDataPoint(dph, fill, icsc){}
</pre>
And I also know to change the bar color depending on the Y value (that I get from the method dph.getOrthogonalValue() :<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeDrawDataPoint(dph, fill, icsc)
{
chart = icsc.getChartInstance();
warn = 70;
crit = 90;
if (dph.getOrthogonalValue() >= warn_marker && dph.getOrthogonalValue() <= crit_marker) {
fill.set(255,155,30);
} else if (dph.getOrthogonalValue() >= crit_marker) {
fill.set(255,55,55);
} else {
fill.set(0,180,0);
}
}
</pre>
But how can I get the X series label and compare it with String to apply a specific color ("Up"=> green bar, "Down" => red bar)?<br />
Thanks for your help.