Dynamic Marker Line based on Data
I built this example based on requirement from a forum post.<br />
The code is in 2 places. The onPageBreak event of the Country report item (I am setting the page variable):
and then I am using the page variable in the onRender event of the chart
-
<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 />
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)); }
0
Categories
- All Categories
- 108 Developer Announcements
- 53 Articles
- 106 General Questions
- 144 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 899 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 120 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management