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