Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Bug in 2.2? Can't get Legend to display on Line Chart
elmatador
EDIT: Apologies if this post isn't in the right place. I saw the forum was for Integration issues and I've been reading the Integrating and extending BIRT book to help resolve my problem<br />
<br />
Hi,<br />
<br />
I've recently written a Line Chart report, and have set the visibility of all of the series on it to hidden.<br />
<br />
Using a list of report parameters, I perform a string-match check on the report parameter item to enable visibility of user-selected series when the report is loaded.<br />
<br />
Unfortunately, this is not causing BIRT to display the series in the legend. It is still invisible there.<br />
<br />
I have ruled out the possibility that the entire legend is not displaying, as I have set a black border to the legend in the Chart GUI. This border shows, but contains no contents.<br />
<br />
Could anyone help? I enclose code which shows my logic for the enabling of the series for visibility, and my attempt to make the legend item also visible.<br />
<br />
I've read Chapter 11 of Integrating and Extending BIRT, which made me wonder if the legend is there, but just out of sight. However I still am without success.<br />
<br />
Thanks,<br />
<br />
Matador<br />
<br />
BEFOREDRAWSERIES:<br />
<br />
//get set of selected series from report params<br />
seriesParam=icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("SeriesArray");<br />
<br />
//set the visibility of the series to true<br />
for (var i=0;i<=seriesParam.length;i++) {<br />
var temp = "" + seriesParam
+ "";<br />
if (temp == series.getSeriesIdentifier()) {<br />
series.setVisible(true);<br />
}<br />
}<br />
<br />
BEFOREFACTORY:<br />
<br />
seriesVis=new Array();<br />
seriesVis=params["rp_seriesvisibility"].value;<br />
reportContext.setPersistentGlobalVariable("SeriesArray", seriesVis);<br />
<br />
<br />
BEFOREDRAWLEGENDITEM:<br />
{<br />
importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl); <br />
icsc.getChartInstance().getLegend().getBounds().set(100,100,100,100);<br />
icsc.getChartInstance().getLegend().getInsets().set(0,0,0,0);<br />
lerh.getLabel().getOutline().setVisible(true);<br />
}<br />
<br />
BEFOREGENERATION:<br />
{<br />
chart.getLegend().setVisible(true);<br />
}
Find more posts tagged with
Comments
mwilliams
Duplicate Question:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/forum/designing-birt-reports/16298-cant-get-legend-item-display.html#post52196'>http://www.birt-exchange.org/forum/designing-birt-reports/16298-cant-get-legend-item-display.html#post52196</a>
;