Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Clear chart series and pass new data
Migrateduser
<p>Hi All,</p>
<p> </p>
<p>I've somewhat achieved my goal but till midway. Using CSV datasource, I increment report variables to get count of a specific data. Now using these variables, I need to plot a bar chart. In the afterDatasetFilled function, I need to clear the existing series and put the report variable data.</p>
<p> </p>
<p>Dataset afterClose method</p>
<pre class="_prettyXprint">
reportContext.setGlobalVariable("Tcad",vars["totalcad"]); </pre>
<p>Chart afterDatasetFilled method</p>
<div>
<pre class="_prettyXprint">
function afterDataSetFilled( series, dataSet, icsc )
{
importPackage( Packages.java.util );
importPackage(Packages.java.lang);
importPackage( Packages.org.eclipse.birt.chart.model.type.impl );
importPackage( Packages.org.eclipse.birt.chart.model.data.impl);
rpCtx=icsc.getExternalContext().getScriptable();
var totalCad=rpCtx.getGlobalVariable("Tcad");
var newseriesarr=new ArrayList();
if(series.getSeriesIdentifier()=="Series1"){
newseriesarr.add(totalCad);
}else{
newseriesarr.add("TotalCAD");
}
if(series.getSeriesIdentifier()=="Series1"){
dataSet.setValues(newseriesarr);
}else{
dataSet.setValues(newseriesarr);
}</pre>
</div>
<p>It is the series clearing and adding the new dataSet, that is pending.</p>
<p> </p>
<p>Or is there any more effective way to achieve the bar chart creation with data aggregation.</p>
<p> </p>
<p>I've attached the rptdeisgn and csv datasource.</p>
Find more posts tagged with
Comments
There are no comments yet