Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Grouped Chart Sorting
RCirne
Hello all,
I have a stacked bar chart and I need to sort it's categories by their Y value. I have a Y series grouping, and because of that I can only sort the categories by the field they refer to and none else.
Is there anyway to work around this?
I am using version 2.3.2.
Thanks in advance.
Find more posts tagged with
Comments
mwilliams
This is true with the x-axis sorting, but the y-series grouping sorting can be done by the y series value. Are you wanting to sort the x-axis differently? If so, you'll probably have to file an enhancement request for this as BIRT 2.6.1 works the same as 2.3.2 does on this.
RCirne
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="71210" data-time="1291915105" data-date="09 December 2010 - 10:18 AM"><p>
This is true with the x-axis sorting, but the y-series grouping sorting can be done by the y series value. Are you wanting to sort the x-axis differently? If so, you'll probably have to file an enhancement request for this as BIRT 2.6.1 works the same as 2.3.2 does on this.<br /></p></blockquote>
<br />
This is bad news to me...<br />
<br />
I am developing reports for Maximo, so changing versions is not an option. Even if it was, you said the lastest version works the same way.<br />
<br />
For what it's worth, I tried the folowing piece of script on the chart, with no result. I also tried manually changing the xml file and that failed also.<br />
<br />
Thanks for the reply, anyway.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
importPackage(Packages.org.eclipse.birt.chart.log);
importPackage(Packages.org.eclipse.birt.chart.model);
importPackage(Packages.org.eclipse.birt.chart.model.component);
importPackage(Packages.org.eclipse.birt.chart.model.data.impl);
/**
* Called before generation of chart model to GeneratedChartState.
*
*
@param
chart
* Chart
*
@param
icsc
* IChartScriptContext
*/
function beforeGeneration( chart, icsc )
{
var xAxis = chart.getAxes().get(0);
var seriesDefinition = xAxis.getSeriesDefinitions().get(0);
seriesDefinition.setSortKey(QueryImpl.create('row["qty"]'));
}
</pre>