Jump to content

BIRT Developer Center Download


Photo
- - - - -

Chart Marker Line - setting style not working

chartscripts marker line set style

  • Please log in to reply
1 reply to this topic

#1 hedgehog

hedgehog

    Member

  • Members
  • PipPip
  • 13 posts

Posted 21 August 2017 - 07:50 AM

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

 

}



#2 hedgehog

hedgehog

    Member

  • Members
  • PipPip
  • 13 posts

Posted 22 August 2017 - 01:06 AM

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







Also tagged with one or more of these keywords: chartscripts, marker line, set style