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)
average progess line
flosmi
hi,
i want to create a average progress line into my linechart (planned tc/days)
how is it possible to create such a line?
thanks
ps:
attached you find my sample chart
Find more posts tagged with
Comments
kclark
You can create a computed column to get the average of your data and then create the marker like this after setting it as a persistent global variable.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>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 avg_value = icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("avg");
avg_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(avg_value));
avg_ml.getLabel().getCaption().setValue("Average");
avg_ml.getLineAttributes().getColor().set(255,0,0);
}
</pre>
flosmi
Hi,
thanks for your reply but i mean a line from zero up to the top over the certain period...
i want to see if we meet your target the planned tc or if we will fail..
kclark
How do you get the planned TC number, is it static or passed to the report from a parameter?