Quantcast
Channel: BIRT Exchange Forum Feed
Viewing all articles
Browse latest Browse all 542

Change datapoint colour according to alternate series value

$
0
0
Hi All,

I want to highlight bars in a stacked bar graph according to a third series value. This means that I cannot use dph.getOrthogonalValue(). For example if my query looks like this:

TYPE COUNT SIZE
------------------
A 40 1.5
A 10 2.2
B 60 4.1

I would like the bars grouped by type, bar size by count and the colour according to value. I tried adding an invisible series to the chart and adding this in the onRender event of the chart.

i = 0;
diffSeries = [];

function afterDataSetFilled(series, dataSet, icsc)
{
	if( series.getSeriesIdentifier() == "SIZE"){
        diffSeries = dataSet.getValues();
    }
}

function beforeDrawDataPoint(dph, fill, icsc)
{

	if (Math.abs(diffSeries[i]) >= 2) {
		fill.set(0,255,0);
	};
	
	i++;
	
}



What I found is that the dataSet values are not ordered in the same way as the data points are rendered. Is there any way to change the fill colour by the "SIZE" value and draw the datapoint according to the "COUNT" value?

I'm using BIRT 2.3.2.

Thanks in advance.

Viewing all articles
Browse latest Browse all 542

Trending Articles