Jump to content

BIRT Developer Center Download


Photo
* * * * * 1 votes

Dynamically change Meter chart scale and regions according column value

BIRT

  • Please log in to reply
6 replies to this topic

#1 amrutaraut99@gmail.com

amrutaraut99@gmail.com

    Member

  • Members
  • PipPip
  • 17 posts

Posted 17 May 2017 - 02:20 AM

Hi Team,

 

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?

 

Can anyone please suggest me any idea on the same ?

 

thanks in Advance.

 

Regards

Amruta.


  • amrutaraut99@gmail.com likes this

#2 Clement Wong

Clement Wong

    Senior Member

  • BIRT Experts
  • 1188 posts

Posted 19 May 2017 - 02:41 PM

You'll need to fetch the column value first before applying it in the meter, and you can do this via the following methods:

  1. API
  2. A hidden table and setting a (PGV) variable so that the meter can access it
  3. In the Data Set's onFetch event and setting a (PGV) variable so that the meter can access it

 

To change the scale, you can look at this DevShare example:

http://developer.act...le-with-script/

 

 

In the example below, we change the end value of the first region to 30,000:

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));
	}                
}

Clement Wong
Principal Analytics Architect

OpenText Corporation
http://www.actuate.com | http://www.opentext.com


#3 amrutaraut99@gmail.com

amrutaraut99@gmail.com

    Member

  • Members
  • PipPip
  • 17 posts

Posted 20 May 2017 - 01:41 AM

Thank you,

Perfect ,its working properly.

 

I have one question is that how to show only one column  value on tip of the needle ?



#4 Clement Wong

Clement Wong

    Senior Member

  • BIRT Experts
  • 1188 posts

Posted 23 May 2017 - 10:47 AM

Thank you,

Perfect ,its working properly.

 

I have one question is that how to show only one column  value on tip of the needle ?

 

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?


Clement Wong
Principal Analytics Architect

OpenText Corporation
http://www.actuate.com | http://www.opentext.com


#5 amrutaraut99@gmail.com

amrutaraut99@gmail.com

    Member

  • Members
  • PipPip
  • 17 posts

Posted 23 May 2017 - 11:03 PM

Thank you for reply.

I want to show only 97.00 value on tip of the needle in current meter.0

this value come from data set(row["sum''])

Attached Files



#6 Clement Wong

Clement Wong

    Senior Member

  • BIRT Experts
  • 1188 posts

Posted 24 May 2017 - 04:55 PM

Sorry, I'm not aware of this capability to show the value near/at the tip of the needle with open source BIRT charts.

 

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...


Clement Wong
Principal Analytics Architect

OpenText Corporation
http://www.actuate.com | http://www.opentext.com


#7 amrutaraut99@gmail.com

amrutaraut99@gmail.com

    Member

  • Members
  • PipPip
  • 17 posts

Posted 01 June 2017 - 09:31 PM

Thanks for your help and best regards  :) 







Also tagged with one or more of these keywords: BIRT