Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
dynamic Max Scale of a meter chart
Migrateduser
<p>Hi<br>
I'm working on a meter chart that shows me the count of each string in a column of a dataset<br>
so to set dynamicaly the scale I used the beforeGeneration method of the meterchart and the onfetch method of the dataset</p>
<p><strong>onFetch script:</strong></p>
<p>reportContext.setPersistentGlobalVariable("Maxpgs", row["pgs_total"].toString() );<br><strong>BeforeGeneration script:</strong></p>
<p>function beforeGeneration( chart, icsc )<br>
{<br><br>
importPackage( Packages.org.eclipse.birt.chart.model.impl );<br>
importPackage( Packages.org.eclipse.birt.chart.model.type.impl );<br>
importPackage( Packages.org.eclipse.birt.chart.model.attribute );<br>
importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );<br>
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );<br>
importPackage(Packages.org.eclipse.birt.chart.model.component.impl);<br>
<br>
seriesDef = chart.getSeriesDefinitions().get(0);<br>
meter1 = seriesDef.getSeriesDefinitions().get(0).getRunTimeSeries().get(0);<br>
mdial = meter1.getDial( );<br>
mscale = mdial.getScale( );<br>
mscale.setStep( 50 );<br>
mscale.setMin( NumberDataElementImpl.create( 0 ) );<br>
max=icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("Maxpgs")<br>
mscale.setMax( NumberDataElementImpl.create( max ) );<br>
<br>
}</p>
<p>it work perfectly when i don't use the optional grouping, but when i use the grouping which allow me to count the number of each string of that column, it set the maximum scale only for the first instance of the chart and let the others with the default value which is 1</p>
<p>So How can i set the Max Scale for all the instances of the meterchart<br><br>
Find more posts tagged with
Comments
There are no comments yet