Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
[BIRT 2.6.2] Stacked bar chart layout issue
Migrateduser
<p>Please see the attached barchart.rptdesign for an example.</p><p> </p><p>I have a data set with columns CATEGORY_NAME, CATEGORY_ORDER, FOLDER_NAME, and COUNT. I want to display this data in a stacked bar chart, with CATEGORY_NAME on the X-axis, COUNT on the Y-axis, and FOLDER_NAME as Y-axis grouping.</p><p> </p><p>This is no problem, except that I want to sort the X-axis by CATEGORY_ORDER. In the attached example, the correct order would be Cat2, Cat1, Cat3.</p><p> </p><p>Since BIRT doesn't allow to order on anything else than the X-axis value, I have implemented a work-around where I prepend CATEGORY_ORDER (with leading zeros) to CATEGORY_NAME for the X-axis value, and then use beforeDrawAxisLabel to remove the leading zeros and CATEGORY_ORDER again.</p><p> </p><p>This works fine; the X-axis is sorted by CATEGORY_ORDER, and it shows CATEGORY_NAME as the X-axis caption. However, BIRT reserves space for the full X-axis value (leading zeros, CATEGORY_ORDER and CATEGORY_NAME), resulting in a lot of white space between the bar chart and the legend.</p><p> </p><p>Any ideas on good ways to solve this layout issue, i.e. to have BIRT automatically reserve the correct amount of space based on the actual CATEGORY_NAME values?</p>
Find more posts tagged with
Comments
There are no comments yet