Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Adding marker line to bar chart
hedgehog
<p>Hi,</p>
<p> </p>
<p>I'm trying to add a marker line on x-axis.</p>
<p> </p>
<p>The code bellow is working fine for y-axis.</p>
<p>I was trying to use the same code for adding marker line to x-axes as well, I just replaced</p>
<p> </p>
<p><span style="color:#000000;">MarkerLineImpl.create(</span><span style="color:#0000cd;">yAxis</span><span style="color:#000000;">, NumberDataElementImpl.create(min_value));</span></p>
<p>by</p>
<p><span> </span><span> </span>MarkerLineImpl.create(<span style="color:#0000cd;">xAxis</span>, NumberDataElementImpl.create(min_value));<span> </span><span> </span></p>
<p> </p>
<p>I tried</p>
<p>var xAxis = chart.primaryBaseAxes[0];</p>
<p>and</p>
<p>var xAxis = chart.getAxes().get(0);</p>
<p> </p>
<p>None of them is working. Any suggestions? Thank you in advance,</p>
<p>Lucy</p>
<p> </p>
<p><span style="color:#0000cd;">function beforeGeneration( chart, icsc )<br>
{<br>
importPackage(Packages.org.eclipse.birt.chart.model.component.impl);<br>
importPackage(Packages.org.eclipse.birt.chart.model.data.impl);<br>
importPackage(Packages.org.eclipse.birt.chart.model.attribute);<br>
importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl);<br>
var chart = icsc.getChartInstance();<br>
var yAxis = chart.getAxes().get(0).getAssociatedAxes().get(0);<br>
var xAxis = chart.primaryBaseAxes[0];<br>
//var xAxis = chart.getAxes().get(0);<br>
var min_value = 1337;<br><br><br>
min_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(min_value));<br>
min_ml.getLabel().getCaption().setValue("Min " + parseFloat(min_value)); <br><br>
}</span></p>
<p>
</p>
Find more posts tagged with
Comments
hedgehog
<p>Hi,</p>
<p> </p>
<p>solved
I needed to make sure that the parameter "Is Category Axis" is unchecked.</p>
<p> </p>
<p>Lucy</p>
micajblock
<p>In any case here is another example - <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/1050-dynamic-x-axis-marker-line-for-bar-chart/'>http://developer.actuate.com/community/forum/index.php?/files/file/1050-dynamic-x-axis-marker-line-for-bar-chart/</a></p>
;