FusionCharts Forum: Flex Web Service And Fusion Widgets - FusionCharts Forum

Jump to content

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

Flex Web Service And Fusion Widgets Using Webservice values to update chart Xml file.

#1 User is offline   Sushma N 

  • Forum Newbie
  • Group: Members
  • Posts: 5
  • Joined: 31-March 11

Posted 13 April 2011 - 08:37 AM

Hi,
-> We have to develop a flex application where we call web service and use the data to update xml file and render the angle gauge widget.
-> Firstly we call web service and get all the data.
-> next Load xml file from the folder and update the dial value and upperlimit value in the xml file using the data got from web service.
-> then use that xml file to render the chart.


Here is the code-->


<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:mgemws="services.mgemws.*"
xmlns:components="com.fusionwidgets.components.*"
initialize="bordercontainer1_creationCompleteHandler(event)" >
<fx:Script>
<![CDATA[
[Bindable]
public var LatestkW:String;
[Bindable]
public var PeakkW:String;
[Bindable]
public var SumkWh:String;
protected var xmlLoader:URLLoader;
[Bindable]
public var loadSupplyXml:XML = new XML;



protected function bordercontainer1_creationCompleteHandler(event:FlexEvent):void
{
getLoadSupplyResult.token = mGEMWS.getLoadSupply("4", "715"); //sending id to getLoadSupply method to get data from Web Service
}



public function init():void
{
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE,setData);
xmlLoader.load(new URLRequest("data/loadSupply.xml")); //loading xml file
}


protected function setData(event:Event):void
{
loadSupplyXml = XML(event.target.data);
loadSupplyXml.@upperLimit = PeakkW;
loadSupplyXml.dials[0].dial.@value = LatestkW;
Alert.show(loadSupplyXml); //shows updated Xml file(it works)
fw.FCDataXML = loadSupplyXml;
fw.FCRender(); //{doesnt work. shows "No data to display"}
}



protected function getLoadSupplyResult_resultHandler(event:ResultEvent):void
{
LatestkW = getLoadSupplyResult.lastResult[0]; //returns the data from web service
PeakkW = getLoadSupplyResult.lastResult[1];
SumkWh = getLoadSupplyResult.lastResult[2];
//once values are got load xml file, update values and apply to chart
init();
}


]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getLoadSupplyResult" result="getLoadSupplyResult_resultHandler(event)"/>
<mgemws:MGEMWS id="mGEMWS" showBusyCursor="true" />
</fx:Declarations>


<components:FusionWidgets id="fw" FCChartType="AngularGauge" FCDataXML="{loadSupplyXml}"/>
</s:BorderContainer>


and the loadSupply.xml is-->
<?xml version="1.0" encoding="UTF-8"?>
<chart decimals="2" palette="2" autoScale="1" showBorder="0" basefontColor="ffffff" gaugeFillRatio="3" bgAlpha='0,0' pivotRadius="6" gaugeInnerRadius="60%"
showTickValues="1" tickValueStep="2" placeTicksInside="0" placeValuesInside="0" showToolTip="1" baseFontSize="9" adjustTM="0" numberSuffix="kW"
pivotFillColor="000000" dataStreamURL="" gaugeStartAngle="225" gaugeEndAngle="-45" gaugeOuterRadius="75" upperLimit="150" lowerLimit="0">


<colorRange>
<color minValue="0" maxValue="1" code="bbbaba"/>
</colorRange>


<dials>
<dial value="29.11" rearExtension="10" baseWidth="10" bgColor="000000"/>
</dials>
</chart>

when i run the application it calls the webservice, get the data, loads the xml file and update the xml file. but when fw.FCDataXML = loadSupplyXml; fw.FCRender(); are used it doesnt renders the gauge.
it shows "No data to display".


Can anyone please help me out in solving the issue..?

Regards,
Sushma

This post has been edited by Sushma N: 13 April 2011 - 08:51 AM

0

Other Replies To This Topic

#2 User is offline   Angshu 

  • Supreme Being
  • Group: Administrators
  • Posts: 3222
  • Joined: 08-December 10

Posted 04 May 2011 - 09:42 AM

Hi,

Thanks for your reply.

We are looking into the issue and will get back to you once we come up with a solution.

Thank you very much for your continued patience and patronage.

Hope you have a great day!
Help us improve our documentation with your precious feedback at:

http://documentation...sioncharts.com/

Best,

Angshu

Follow us on @Twitter


0

Other Replies To This Topic

#3 User is offline   Sudipto Choudhury 

  • Supreme Being
  • Group: Administrators
  • Posts: 1919
  • Joined: 19-March 07

Posted 09 May 2011 - 01:22 PM

Hi,

Could you please try once with this?

fw.FCSetDataXML(loadSupplyXml.toString()) ;

Please do not use FCRender() as FCSetDataXML() will make the chart render internally.
Regards,

Sudipto Choudhury
FusionCharts Team

Follow us on Twitter

I code, therefore I am.

0

Other Replies To This Topic

#4 User is offline   Sanjukta 

  • Supreme Being
  • Group: Administrators
  • Posts: 1664
  • Joined: 15-March 10

Posted 31 May 2011 - 06:39 AM

Hi,

Please check with the following Forum link thread for your reference.
http://forum.fusionc...5567#entry35567

Hope this helps. :)
Help us improve our documentation with your precious feedback at:
http://documentation...sioncharts.com/

Thanks,
Sanjukta

Follow us @Twitter!
0

Other Replies To This Topic

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