Im new here, if threads are this old, are the attached report examples deleted or are they hidden in a way I cant easily see them
Thank you @Grimmr74
It looks like this conversation was migrated from a previous system, and unfortunately the attachment was not included in the process. We do not have the original attachment available, nor the attachment in @JEFreeman 's comment. Our apologies for this inconvenience.
Hi, my BIRT designer version is 4.9.0, and the parameters in beforeDrawSeries have changed. How to control legend order in this function now. Could anyone please help me with this problem?
/** * Called before rendering Series. * * @param series * Series * @param isr * ISeriesRenderer * @param icsc * IChartScriptContext */ function beforeDrawSeries( series, isr, icsc ) { }
I solve the problem by swapping the left and right item locations, the order will be reversed. It works fine for me.
function beforeRendering( gcs, icsc ) { var legendItems = gcs.getRunTimeContext().getLegendLayoutHints().getLegendItemHints( ); for( i=0; i < legendItems.length / 2; i++ ){ // left item and right item var leftItem = legendItems[i]; var rightItem = legendItems[legendItems.length-1-i]; //swap their location(top, left) top = leftItem.getTop(); left = leftItem.getLeft(); leftItem.top(rightItem.getTop()); leftItem.left(rightItem.getLeft()); rightItem.top(top); rightItem.left(left); } }