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)
Dynamically change Meter chart scale and regions according column value
amrutaraut99@gmail.com
<p>Hi Team,</p>
<p> </p>
<p>I am creating meter chart using BIRT ,i want to change the meter regions value according fetched column value and also change scale according fetch column value+30%of that same column value ,this is actually meter structure and needle will show the another column value in the above mentioned meter.How to dynamically change regions and scale?</p>
<p> </p>
<p>Can anyone please suggest me any idea on the same ?</p>
<p> </p>
<p>thanks in Advance.</p>
<p> </p>
<p>Regards</p>
<p>Amruta.</p>
Find more posts tagged with
Comments
Clement Wong
<p>You'll need to fetch the column value first before applying it in the meter, and you can do this via the following methods:</p>
<ol><li>API</li>
<li>A hidden table and setting a (PGV) variable so that the meter can access it</li>
<li>In the Data Set's onFetch event and setting a (PGV) variable so that the meter can access it</li>
</ol><p> </p>
<p>To change the scale, you can look at this DevShare example:</p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/664-change-meter-scale-with-script/'>http://developer.actuate.com/community/forum/index.php?/files/file/664-change-meter-scale-with-script/</a></p>
;
<p> </p>
<p> </p>
<p>In the example below, we change the end value of the first region to 30,000:</p>
<pre class="_prettyXprint _lang-">
function beforeGeneration( chart, icsc )
{
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
var seriesDef = chart.getSeriesDefinitions().get(0);
var seriesIterator = seriesDef.getSeriesDefinitions().get(0).getRunTimeSeries().listIterator();
while(seriesIterator.hasNext()){
var meter = seriesIterator.next();
var meterDial = meter.getDial();
// Get a handle to the first region and set the end value to 30,000
var dialRegions = meterDial.getDialRegions();
var dialRegion1 = dialRegions.get(0);
dialRegion1.setEndValue(NumberDataElementImpl.create(30000));
var meterScale = meterDial.getScale();
meterScale.setStep(3);
meterScale.setMin(NumberDataElementImpl.create(0));
meterScale.setMax(NumberDataElementImpl.create(80000));
}
}
</pre>
amrutaraut99@gmail.com
<p>Thank you,</p>
<p>Perfect ,its working properly.</p>
<p> </p>
<p>I have one question is that how to show only one column value on tip of the needle ?</p>
Clement Wong
<blockquote class="ipsBlockquote" data-author="amrutar" data-cid="147691" data-time="1495273281">
<div>
<p>Thank you,</p>
<p>Perfect ,its working properly.</p>
<p> </p>
<p>I have one question is that how to show only one column value on tip of the needle ?</p>
</div>
</blockquote>
<p> </p>
<p>I'm sorry I don't quite understand your latest requirement. Column? Can you please share a screenshot of what you are currently seeing, and another screenshot of what you would like to see?</p>
amrutaraut99@gmail.com
<p>Thank you for reply.</p>
<p>I want to show only 97.00 value on tip of the needle in current meter.0</p>
<p>this value come from data set(row["sum''])</p>
Clement Wong
<p>Sorry, I'm not aware of this capability to show the value near/at the tip of the needle with open source BIRT charts.</p>
<p> </p>
<p>In commercial BIRT, with the HTML5 charts, it's possible. Or if you want in open source BIRT, you can use a JavaScript chart like D3.js, HighCharts, etc...</p>
amrutaraut99@gmail.com
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Thanks for your help and best regards
</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span></p>