Changing x-axis labels only
Hi there,<br />
<br />
I have implemented the following beforeDrawAxisPoint method, but this currently updates labels on both x and y axis. However, I only want to change the x axis labels and cannot figure out how to:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeDrawAxisLabel(axis, label, icsc)
{
importPackage(Packages.org.eclipse.birt.core.script);
reportDate = icsc.getExternalContext().getScriptable().getParameterValue("reportDate");
value = label.getCaption().getValue();
if (value == 0){
label.getCaption().setValue("Overdue");
} else if (value == 1){
label.getCaption().setValue("Due " + reportDate);
} else if (value == 2){
label.getCaption().setValue("Due " + DateTimeSpan.addDate(reportDate, 0, 0, 7));
} else if (value == 3){
label.getCaption().setValue("Due " + DateTimeSpan.addDate(reportDate, 0, 0, 14));
} else if (value == 4){
label.getCaption().setValue("Due " + DateTimeSpan.addDate(reportDate, 0, 0, 21));
} else if (value == 5){
label.getCaption().setValue("Due " + DateTimeSpan.addDate(reportDate, 0, 0, 28));
} else {
label.getCaption().setValue("");
}
}
</pre>
<br />
I guess it has something to do with axis.getType() but if I test this against axis.BASE, the transformation does not apply to any axis, and if I remove that test, it then applies to both.<br />
<br />
Any suggestions?<br />
<br />
Regards,<br />
Cedric
<br />
I have implemented the following beforeDrawAxisPoint method, but this currently updates labels on both x and y axis. However, I only want to change the x axis labels and cannot figure out how to:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeDrawAxisLabel(axis, label, icsc)
{
importPackage(Packages.org.eclipse.birt.core.script);
reportDate = icsc.getExternalContext().getScriptable().getParameterValue("reportDate");
value = label.getCaption().getValue();
if (value == 0){
label.getCaption().setValue("Overdue");
} else if (value == 1){
label.getCaption().setValue("Due " + reportDate);
} else if (value == 2){
label.getCaption().setValue("Due " + DateTimeSpan.addDate(reportDate, 0, 0, 7));
} else if (value == 3){
label.getCaption().setValue("Due " + DateTimeSpan.addDate(reportDate, 0, 0, 14));
} else if (value == 4){
label.getCaption().setValue("Due " + DateTimeSpan.addDate(reportDate, 0, 0, 21));
} else if (value == 5){
label.getCaption().setValue("Due " + DateTimeSpan.addDate(reportDate, 0, 0, 28));
} else {
label.getCaption().setValue("");
}
}
</pre>
<br />
I guess it has something to do with axis.getType() but if I test this against axis.BASE, the transformation does not apply to any axis, and if I remove that test, it then applies to both.<br />
<br />
Any suggestions?<br />
<br />
Regards,<br />
Cedric
0
Comments
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