FusionCharts Forum: Programatically Change Angular Gauge properties - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Programatically Change Angular Gauge properties

#1 User is offline   nabyendu 

  • Forum Newbie
  • Group: Members
  • Posts: 3
  • Joined: 05-March 10

Posted 05 March 2010 - 03:46 AM

Hi,

I am integrating FusionWidget Angular Gauge in my web application. I am using setDataUrl(string path_to_xml). This will render the gauge with the values supplied in XML file. This is fine.

Now I want to change some properties for gauge e.g, lowerLimitDisplay,upperLimitDisplay,gaugeStartAngle,gaugeEndAngle,

paletteThemeColor etc. before rendering gauge. That mean  I want to change those property values supplied in XML file before rendering the gauge.

Could you tell me how to acheive this ?

Thanks & Regards

Nabyendu Adhikari


0

Other Replies To This Topic

#2 User is offline   Madhumita 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1434
  • Joined: 04-September 09

Posted 05 March 2010 - 04:06 AM

Hello,
Welcome to FusionCharts Forum.

You would need to add and set values to these attributes in the <chart> element inside the XML.

e.g. <chart lowerLimitDisplay='0'  upperLimitDisplay='100' >

I hope this helps you.

Regards,
Madhumita Chakraborty

Follow us on Twitter :)
0

Other Replies To This Topic

#3 User is offline   nabyendu 

  • Forum Newbie
  • Group: Members
  • Posts: 3
  • Joined: 05-March 10

Posted 05 March 2010 - 04:38 AM

Hi Madhumita,

My data.xml file content is like that

<chart lowerLimit='0' upperLimit='100' lowerLimitDisplay='Bad' upperLimitDisplay='Good' gaugeStartAngle='135' gaugeEndAngle='45' gaugeOriginX='130' gaugeOriginY='180' gaugeOuterRadius='140' palette='1' numberSuffix='%' tickValueDistance='20' showValue='1' majorTMHeight='10' minorTMHeight='5'>

....

</chart>

I  am using this code

var chart = new FusionCharts( "Charts/AngularGauge.swf", div, width, height, "0", "1" );

chart.setDataURL( "data.xml" );

<--------------- Here I want to change gaugeStartAngle to '0' and  gaugeEndAngle to '180'

chart.render( divId );

Is this possible?

Thanks & regards

Nabyendu Adhikari


0

Other Replies To This Topic

#4 User is offline   Madhumita 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1434
  • Joined: 04-September 09

Posted 05 March 2010 - 05:06 AM

Hello,

Firstly give an unique id to your chart.
var chart = new FusionCharts( "Charts/AngularGauge.swf", 'Chart1Id', width, height, "0", "1" );

After rendering the chart you can create a string XML say var XMLData = <here you provide the new XML>

Now, you get the chart by its id and do a setdataXMl on that. The chart gets updated internally.
e.g. var chartObj= getChartFromID('id of the chart');
chartObj.setDataXML(XMLData);


Regards,
Madhumita Chakraborty

Follow us on Twitter :)
0

Other Replies To This Topic

#5 User is offline   nabyendu 

  • Forum Newbie
  • Group: Members
  • Posts: 3
  • Joined: 05-March 10

Posted 05 March 2010 - 06:32 AM

Hi Madhumita,

I have used chart.setAttribute("width", "600"); chart.setAttribute("height", "180"); which changes the chart size. I have also found other two methods in FusionCharts.js file viz; addParam and addVariable.

var chart = new FusionCharts( "Charts/AngularGauge.swf", "chartID", "200", "200", "0", "1" );

chart.setDataURL("data.xml");

chart.setAttribute("width", "600");  <---- final chart width is 600 although in constructor we provide width value as 200

chart.setAttribute("height", "180"); <---- final chart height is 180 although in constructor we provided height value as 200

chart.render( "chartID");

But I want to change other properties like gaugeStartAngle,gaugeEndAngle.

Can we do it without creating new XML  ?

Thanks & Regards

Nabyendu Adhikari


 

0

Other Replies To This Topic

#6 User is offline   Rahul Kumar 

  • Supreme Being
  • Group: Moderators
  • Posts: 1034
  • Joined: 18-March 08

Posted 05 March 2010 - 07:50 AM

Hi Nabyendu,

I am afriad, it is not possible as those attributes works from XML itself. 

Regards,
Rahul Kumar
Software Engineer

A byte of magic.

 
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic