How to set background of graph marker line text programmaly?
I use this function to set graph marker line:
function beforeGeneration(chart, 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);
var chart = icsc.getChartInstance();
var yAxis = chart.getAxes().get(0).getAssociatedAxes().get(0);
var ok_value = 40;
ok_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(ok_value));
ok_ml.getLabel().getCaption().setValue("Test value " + ok_value);
ok_ml.getLabel().getCaption().getFont().setSize(10);
ok_ml.getLabel().getCaption().getFont().setBold(true);
ok_ml.getLabel().getCaption().getFont().setRotation(90);
//ok_ml.getLabel().getCaption().getFont().setBackground(0,255,0);
ok_ml.getLineAttributes().getColor().set(255,0,0);
ok_ml.getLineAttributes().setThickness(3);
}
How to set marker line text background color?
"ok_ml.getLabel().getCaption().getFont().setBackground(0,255,0);" return this error:
"Cannot find function setBackground in object org.eclipse.birt.chart.model.attribute.impl.FontDefinitionImpl@..."
Thanks
Comments
-
I don't know if this is a textbook solution, but I will count it as an achievement unlocked. I copied your code into the chart script in the attached report and added the code at the bottom to change the fill color. Please test the code before using it in production.
Warning No formatter is installed for the format ipb0
Categories
- All Categories
- 109 Developer Announcements
- 49 Articles
- 100 General Questions
- 122 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
- 122 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management