Home
Analytics
Need help with chart API: change line style of marker
MikeyD
<p>Hi,</p>
<p> </p>
<p>I use a script to (dynamically) add a marker line to a bar chart. I do this with the following code:</p>
<p> </p>
<p style="font-size:11px;font-family:Monaco;">ml1 = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(target), ColorDefinitionImpl.create(0,0,0)); <span style="color:#4e9072;">//set marker on Target value in black color</span></p>
<p style="font-size:11px;font-family:Monaco;">ml1.getLabel().getCaption().setValue(<span style="color:#3933ff;">' '</span>); <span> </span><span style="color:#4e9072;">// remove label</span></p>
<p style="font-size:11px;font-family:Monaco;">ml1.getLineAttributes().setThickness(1);<span> </span><span style="color:#4e9072;">// change thickness of line</span></p>
<p> </p>
<div>However, by default the line style seems to be dashed where I need it to be solid.</div>
<div> </div>
<div>I have tried all kind of statements to change the line style to solid, but can't get it to work.</div>
<div> </div>
<div>Can someone please help me with the correct statement?</div>
<div> </div>
<div>Thanks for your support.</div>
<div> </div>
<div>Mikey</div>
Find more posts tagged with
Comments
Matthew L.
<p>This is untested however looking over the API documentation (<a data-ipb='nomediaparse' href='
http://help.eclipse.org/luna/index.jsp?topic=/org.eclipse.birt.chart.doc.isv/chart/api/org/eclipse/birt/chart/model/component/impl/MarkerLineImpl.html'>http://help.eclipse.org/luna/index.jsp?topic=/org.eclipse.birt.chart.doc.isv/chart/api/org/eclipse/birt/chart/model/component/impl/MarkerLineImpl.html</a>)
I believe this might work for you:</p>
<pre class="_prettyXprint _lang-js">
ml1.setLineAttributes( /*(LineAttributes newLineAttributes)*/
org.eclipse.birt.chart.model.attribute.impl.LineAttributesImpl.create( /*(ColorDefinition cd, LineStyle ls, int iThickness)*/
org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionImpl.create( 0, 0, 0 ), /*(int iRed, int iGreen, int iBlue)*/
org.eclipse.birt.chart.model.attribute.LineStyle.SOLID_LITERAL, /*DASH_DOTTED_LITERAL, DASHED_LITERAL, DOTTED_LITERAL, SOLID_LITERAL)*/
1
)
);
</pre>
<p>If this doesn't work for you, please attach an example design to examine</p>