Legend Overlap Issue

Options
modonnell
edited February 11, 2022 in Analytics #1
I am using birt v2.2.2 and I am experiencing an issue with the legend overlapping. I found a bug already submitted for this issue. <a class='bbc_url' href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=211773'>https://bugs.eclipse.org/bugs/show_bug.cgi?id=211773</a><br />
<br />
I also saw that it was fixed in v2.3. What I am wondering is if anyone knew the fix, if there was a patch for v2.2.2, or even a work around? Any help would be greatly appreciated.

Comments

  • JasonW
    edited December 31, 1969 #2
    Options
    You may be able to play with the insets and the bounds a little:

    Something like

    function beforeDrawLegendItem(lerh, bounds, icsc)
    {

    importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );

    if( bounds.getLeft() >50 ){
    bounds.setLeft(bounds.getLeft() + 15);
    lerh.getLabel().getInsets().setLeft( 15);
    }else{
    lerh.getLabel().getInsets().setLeft( 2 );
    }



    importPackage( Packages.java.io );
    out = new PrintWriter( new FileWriter( "c:/test/chartevents.txt", true ) );
    out.println( lerh.getLabel().getCaption().getValue() );
    out.println( "BOUNDS = L" + bounds.getLeft() + " T " + bounds.getTop() + " W " + bounds.getWidth() + " H " + bounds.getHeight());
    out.println( "Insets = R" + lerh.getLabel().getInsets().getRight() + " L " + lerh.getLabel().getInsets().getLeft() + " B " + lerh.getLabel().getInsets().getBottom() + " T " + lerh.getLabel().getInsets().getTop());
    out.close();


    }

    The attached example modifies the bugzilla example.

    Jason