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)
X-axis data value sorting on stacked bar chart graph not fully working
AlbertYu
Hello,<br />
<br />
I am using BIRT version 2.5.0 coupled with Troux version 9.0. Due to the coupling I am therefore unable to upgrade to the latest version of BIRT.<br />
<br />
I have a report with a data set that is ordered by Column D, in a descending fashion. I wish to display Column A's contents in the order ordered by Column D.<br />
Example: SELECT name, city, pc_count, visit_count FROM tableA ORDER BY DESC visit_count<br />
Data set returns the information as expected ordered by visit_count.<br />
<br />
I have linked this data set to a stacked bar chart.<br />
<br />
The x-axis of the bar chart displays Column A's (name) contents. As mentioned before, I wish this ordered in the order set by Column D (visit_count) of the data set.<br />
<br />
The y-axis of the bar chart displays Column B's (city) contents.<br />
<br />
And the optional Y series grouping is linked to Column C's (pc_count) contents.<br />
<br />
My colleague and I was attemping to sort the x-axis information according to the sort order of the data set, as ordered by Column D of the data set.<br />
<br />
We couldn't achieve this result, but in the process, we discovered the following:<br />
<br />
1. If I remove the optional Y series grouping, the GUI then allows us to set the sort order for the X Series to the field wanted (visit_count), then the x-axis is properly sorted the way we want. But obviously the chart doesn't show the optional Y series grouping, which we want <span class='bbc_underline'>as well</span>.<br />
<br />
2. Adding the optional Y Grouping back in, greys out the ability to set the sort order for the X Series, and the X Series reverts back to be sorted by Column A (name).<br />
The Help screen indicates that if no sort order is selected then the fields would be displayed in the order returned by the query. This unfortunately does not seem to be the case if the Optional Y grouping is selected.<br />
<br />
Neither 1 or 2 is exactly what my colleague and I want.<br />
<br />
Is there a way to have the graph sorted in the way we want <span class='bbc_underline'>and also</span> have the optional Y series grouping in place as well?<br />
<br />
Is ths a known bug? Is it fixed in a later verison of BIRT?<br />
<br />
<br />
Thank you,<br />
<br />
Albert
Find more posts tagged with
Comments
mwilliams
Can you create a report using the sample database that shows what you're doing and describe what you want? I'll take a look.
AlbertYu
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="98648" data-time="1333654685" data-date="05 April 2012 - 12:38 PM"><p>
Can you create a report using the sample database that shows what you're doing and describe what you want? I'll take a look.<br /></p></blockquote>
<br />
<br />
Hi Michael,<br />
<br />
Please see the 2 picture attachments.<br />
<br />
Please note the filenames on both files too. They have useful descriptions on them that describe what the bar chart currently is like.<br />
<br />
Basically, what my team and I want is "sorted and has optional Y series in the bar graph".<br />
<br />
Is this possible?<br />
<br />
<br />
Thanks,<br />
<br />
Albert
mwilliams
I was going to suggest that you could maybe use a grouped table as a source to try to get around this, but in 2.5.0, it doesn't seem to work correctly using optional grouping with a table as the source. You might try computing the totals for each x axis category and adding a computed column that adds a sort order to the front of the field value, so that you can just use the ascending or descending. There might be more options if you were able to upgrade, but I'm not sure. I can try to make an example, if you'd like. Let me know.
AlbertYu
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="98781" data-time="1334081172" data-date="10 April 2012 - 11:06 AM"><p>
I was going to suggest that you could maybe use a grouped table as a source to try to get around this, but in 2.5.0, it doesn't seem to work correctly using optional grouping with a table as the source. You might try computing the totals for each x axis category and adding a computed column that adds a sort order to the front of the field value, so that you can just use the ascending or descending. There might be more options if you were able to upgrade, but I'm not sure. I can try to make an example, if you'd like. Let me know.<br /></p></blockquote>
<br />
Michael,<br />
<br />
I find it easier to understand with an example, as most people do I believe.<br />
<br />
Could you please make an example? <br />
<br />
Thanks.
mwilliams
Sorry for the delay. Here's a way to do it. You can probably make this better, but this will get you a starting point. Upgrading might make this a little bit easier, too, whenever you can. I have not looked at this exact issue in the newest version, yet, though. Let me know if you have questions.
AlbertYu
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="100154" data-time="1336579954" data-date="09 May 2012 - 09:12 AM"><p>
Sorry for the delay. Here's a way to do it. You can probably make this better, but this will get you a starting point. Upgrading might make this a little bit easier, too, whenever you can. I have not looked at this exact issue in the newest version, yet, though. Let me know if you have questions.<br /></p></blockquote>
<br />
<br />
Thanks for this Michael. I am getting 90% of it at the moment.<br />
<br />
I just need to learn what the script does.<br />
<br />
Can you please point me to a good BIRT scripting API documentation? I have the following, but it doesn't help much:<br />
<br />
<a class='bbc_url' href='
http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.birt.doc.isv/enginescript/api/org/eclipse/birt/report/engine/api/script/instance/IReportElementInstance.html'>http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.birt.doc.isv/enginescript/api/org/eclipse/birt/report/engine/api/script/instance/IReportElementInstance.html</a><br
/>
<br />
Thanks again.<br />
<br />
Albert
mwilliams
That's probably going to be your best overall resource. Other than that, devShares, blogs, and forum posts showing how to do specific things are going to be the big helper. What specific questions do you have? I'll try to explain.