<p>I’m trying to modify code that uses the follow technique to create a chart. Where can I find documentation that discusses building charts this way? I’m particularly interested in building a stacked bar chart. And I need to understand ExtendedItemHandle and DataRowExpressionEvluators.</p><p>cm = getChart();</p><p>String[] expressions = { "row["RESOURCE_ID"]", "row["RESOURCE_ID_NAMESPACE"]", "row["AVGDURATION"]"};
Object[][] data = dataSrc.getData();</p><p>dree = new SimpleDataRowExpressionEvaluator(expressions, data);</p><p>Generator gr = Generator.instance();</p><p> gr.bindData(dree, cm, rtc);</p><p>gr.build(idr.getDisplayServer(), cm, bo, null, null, null);</p><p> </p><p>
@Override
public Chart getChart()
{
Chart cm = null;
final DesignConfig dConfig = new DesignConfig();
IDesignEngine dEngine = null;
ReportDesignHandle dHandle = null;</p><p> try
{
Platform.startup(null);
final IDesignEngineFactory dFactory =
(IDesignEngineFactory) Platform
.createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY);
dEngine = dFactory.createDesignEngine(dConfig);
final SessionHandle sessionHandle =
dEngine.newSessionHandle(ULocale.ENGLISH);
final Bundle bundle =
org.eclipse.core.runtime.Platform.getBundle(getBundleID());
final URL url =
FileLocator.find(bundle, new Path(getReportDesignFilename()), null);
final String reportName = FileLocator.toFileURL(url).getPath();
dHandle = sessionHandle.openDesign(reportName);
final ExtendedItemHandle li =
(ExtendedItemHandle) dHandle.getBody().getContents().get(0);
cm = (Chart) li.getReportItem().getProperty("chart.instance");
}
catch (final BirtException e)
{
e.printStackTrace();
}
catch (final IOException e)
{
e.printStackTrace();
}
return cm;
}</p>