On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.

Chart width of 100%

allachan
allachan Junior Member
Back in BIRT 2.1.3 (at least with the RCP designer), I could set the chart width to 100% and it would scale to fit its container.

Now I find with BIRT 2.2.1 using the Eclipse designer, '%' is not an option for the width.

How do I create a chart that fills its container? Do I need to resort to some JavaScript voodoo magic?

Cheers,
Pax.

Comments

  • Virgil
    Virgil Administrator EM admin
    edited 1969 31 #2
    Hi Pax,

    I understand that the percentage (%) feature was removed as a chart width and height option since it was causing a distorted image to be created and the interactivity (drill-down) features were not lining up correctly. The problem would surface when the browser width caused the grid, or table, to expand to fill the space, which would stretch the chart... long after it was generated for a specified width. I don't know of any way to force the chart width to match the container's width since the container width can change at the browser, however, there are ways to modify the chart width in script if you want to play with this some.

    Try this in the beforeFactory event on the report design

    var myparam = params["SizeParameter"]
    this.getReportElement("NewChart").setWidth(myparam+"pt");

    Virgil