Auto Adjust Height and Width of BIRT CHART based on Axis Values

prince_iamprince_iam BIRT & Oracle Developer

Dear BIRT GURUs,

I found this forum very helpful, I hope this time will it be. I want to adjust the height and width of the birt chart based on the number of axis and values.

When I generated the report for the three (03) months the chart bar sizes and values were adequately visible.

When I generated the report for the twelve (12) months (year) the chart bar sized and values were shrunk.

Can anybody help to fix this issue and adjust the chart dimension dynamically based on the number of axis and values to properly display data for any period of time. Thank you in anticipation.

Comments

  • In the attached example, I created a computed column in the data set and added it as an Optional Y Series Grouping in the chart. It creates 14 series (groups). The chart script increases the width of the chart if the number of series is greater than 10. Note that the Master Page must be wide enough to handle the increased width.

    Jeff F.
    Customer Support Engineer I
    OpenText
  • prince_iamprince_iam BIRT & Oracle Developer

    Dear Jeff,
    I found a much simpler solution to this problem at the following thread.
    http://birtworld.blogspot.com/2008/04/birt-resizing-charts.html

  • Hi Prince,

    Thanks for posting the link.

    It looks like the code is the same as mine. Both linked code and my code use .getBlock().getBounds().setWidth() in beforeGeneration to set the width of the chart. I added code to check the series count and conditionally change the width based on the count because that was your requirement.

    Jeff F.
    Customer Support Engineer I
    OpenText
Sign In or Register to comment.