Runtime Control of Y-axis Labels in Chart
Options
Comments
-
Hi jeffreymac,
There are a couple of event handlers needed to get at the values, and format the axis label. Below is a javascript example that may work for you. This one will color the label corresponding to the largest data value.
var maxval=0;
var dataSetProcessor;
function beforeDataSetFilled(series, idsp, icsc) {
dataSetProcessor = idsp;
}
function afterDataSetFilled(series, dataSet, icsc) {
maxval = dataSetProcessor.getMaximum( dataSet );
}
function beforeDrawAxisLabel(axis, label, icsc)
{
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
importPackage(Packages.org.eclipse.birt.chart.model);
importPackage(Packages.org.eclipse.birt.chart.model.data);
importPackage(Packages.org.eclipse.birt.chart.model.data.impl);
if (maxval <= parseFloat(label.getCaption().getValue())) {
if (axis.getType() != AxisType.TEXT_LITERAL) {
label.getCaption().getColor( ).set( 208, 32, 0);
}
}
}Warning No formatter is installed for the format ipb0 -
Thanks very much for the fast response and help! The code you provided worked fine. For some reason I had to remove the import statements to prevent errors.0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 103 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax