Adjust Alignment of Label to Right and Fix Label Truncating Issue in Stacked Bar Chart
Softwares:
Jasper Server 5.6.0
IReport 5.6.0
Now we will see how to work on Labels Alignment and fix truncating in Stacked Bar Chart
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
First create a sample report which includes Stacked Bar Chart
Report Output in Jasper Server as follows
Expected Output in Jasper Server as follows
In order to achieve Expected Output, write custom code in java and include below lines of code:
For Label Alignment include below line
plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
For avoid truncating Labels include below line
categoryAxis.setMaximumCategoryLabelWidthRatio(3.0F);
Create jar file of the java code and add it in chart customiser property of chart in the format: ‘packagename.classname’ as follows:-
Refer the screenshot:
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
Publish the Report,and add the Jar for the Report which had published
Right Click on the Report –>Edit
Control Resources –>Add Resource–>Upload Jar
Give a valid name and then Submit
Execute the Report and output as follows
Best Open Source Business Intelligence Software Helical Insight is Here
A Business Intelligence Framework
Thanks,
Satya Gopi,
BI Developer