I built this example based on requirement from a forum post.<br />
<br />
- I am using the Drop-Detail on the cell with the chart (that is why it looks like the chart and details are together).<br />
- I created a marker<br />
- I created a page variable to store data.<br />
- I dynamically adjusted the marker based on the data.<br />
<br />
The code is in 2 places. The onPageBreak event of the Country report item (I am setting the page variable):
if (this.getRowData().getColumnValue("COUNTRY") == "UK") {
vars["currentMarker"] = 5;
}
else {
vars["currentMarker"] = 7;
}
<br />
and then I am using the page variable in the onRender event of the chart
function beforeDrawMarkerLine( axis, markerLine, icsc )
{
importPackage(Packages.org.eclipse.birt.chart.model.component.impl);
importPackage(Packages.org.eclipse.birt.chart.model.data.impl);
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl);
importPackage(Packages.org.eclipse.birt.chart.util);
var ci =icsc.getExternalContext().getScriptable().getPageVariable("currentMarker");
markerLine.setValue(NumberDataElementImpl.create(ci));
}