Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Optional Y Series Grouping
eddy00
Hi,<br />
<br />
I created a chart with one x-axis, two y-axis and one optional Y series grouping in chart editor. All shows fine.<br />
Now i want to use script for building my second series, because i want to add it dynamically. <br />
<br />
My problem is, i don`t know how to do it when i use the optional y series grouping. In my Legend, there are missing the names.<br />
<br />
Look on my File. There are screenshots and my implementation.<br />
<br />
Thanks for help.<br />
<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
importPackage(Packages.java.util);
importPackage(Packages.org.eclipse.birt.chart.model.data.impl);
importPackage(Packages.org.eclipse.birt.chart.model.component.impl);
importPackage(Packages.org.eclipse.birt.chart.model.type.impl);
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl);
importPackage(Packages.org.eclipse.birt.chart.model.impl);
importPackage(Packages.org.eclipse.birt.chart.model.component);
cht = reportContext.getDesignHandle().findElement("MyChart");
mychart = cht.getReportItem().getProperty("chart.instance");
xAxis = mychart.getAxes().get(0);
yAxis = xAxis.getAssociatedAxes().get(0);
for(i=2; i<3; i++) {
var sdNew = SeriesDefinitionImpl.create();
var ls = LineSeriesImpl.create();
var qry = QueryImpl.create("row[\"CUSTOMERNUMBER\"]");
ls.getDataDefinition().add(qry);
ls.getLineAttributes().setColor(ColorDefinitionImpl.BLACK());
ls.getMarkers().clear();
sdNew.getSeries().add(ls);
yAxis.getSeriesDefinitions().add(sdNew);
}
</pre>
Find more posts tagged with
Comments
mwilliams
Hi eddy00,
Is the 2nd series, the one you're adding in script, supposed to go on the 1st y-axis or the 2nd y-axis?