Dynamic X-Axis Marker Line for Bar Chart
I built this example per request from an OS BIRT developer. The required a bar chart where the colors of the bars were based on it's values and there were 2 marker lines based on data.<br />
First I created a table with the values of the two marker lines. In the onCreate even of the report items I set the value to persistent global variables. The visibility of the table was set to false.<br />
<br />
I then created the chart. I overrode the onRender event to change the colors of the bars base on the X-Axis values and changed the values of the markers based on the values of the persistent global variables.<br />
<br />
The second part was tricky as if 'Is Category Axis' is checked (X-Axis portion of the format chart tab) then the value of the marker is based on the number of bars (1 would be the first tick, 2 the second tick...). If it is unchecked then the marker value would be the value of the X-Axis.<br />
<br />
In this case I needed it checked, so I had to perform some extra calculations.<br />
<br />
See image below for result<br />
<br />
First I created a table with the values of the two marker lines. In the onCreate even of the report items I set the value to persistent global variables. The visibility of the table was set to false.<br />
<br />
I then created the chart. I overrode the onRender event to change the colors of the bars base on the X-Axis values and changed the values of the markers based on the values of the persistent global variables.<br />
<br />
The second part was tricky as if 'Is Category Axis' is checked (X-Axis portion of the format chart tab) then the value of the marker is based on the number of bars (1 would be the first tick, 2 the second tick...). If it is unchecked then the marker value would be the value of the X-Axis.<br />
<br />
In this case I needed it checked, so I had to perform some extra calculations.<br />
<br />
See image below for result<br />
<br />
0
Categories
- All Categories
- 107 Developer Announcements
- 53 Articles
- 104 General Questions
- 141 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 898 Cloud Fax and Notifications
- 76 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 118 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management