Chart Marker Line - setting style not working

Hello,


 


I'm trying to change the line style for marker lines. With the following code, the lines' color and labels are


chaning but not the style.


Any idea where the error is?


 


Thank you in advance,


Lucy


 


 


 


 


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.impl);

 


/* calculation of variables lower_limit and upper_limit */

 

 

 var chart = icsc.getChartInstance();

 var yAxis = chart.getAxes().get(0).getAssociatedAxes().get(0);


 min_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(lower_limit));

 min_ml.getLabel().getCaption().setValue("Lower Limit");

 min_ml.getLineAttributes().getColor().set(255,0,0);

 min_ml.getLineAttributes().setStyle(LineStyle.DASH_DOTTED_LITERAL);



 max_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(upper_limit));

 max_ml.getLabel().getCaption().setValue("Upper Limit");

 max_ml.getLineAttributes().getColor().set(0,0,255);

 max_ml.getLineAttributes().setStyle(LineStyle.SOLID_LITERAL);


 


}


Comments

  • The best thing is when you figured out on your own :)


    So, for all interested - it was because of missing package


     


    importPackage( Packages.org.eclipse.birt.chart.model.attribute );


     


    Have a nice day,


    Lucy


Sign In or Register to comment.