0

If I set my HLED Widget's FCDataURL to some a valid XML the LED shows up fine but now I want to change the HLED's value programatically. For this purpose, I have made a string named xmlData, containing data from an XML file as shown below:

String for XML:

 private var  xmlData:String="<?xml version='1.0' encoding='UTF-8'?>" +
                    "<chart chartBottomMargin='5' lowerLimit='0' upperLimit='100' lowerLimitDisplay='Low' " +
                    "upperLimitDisplay='High' numberSuffix='' showTickMarks='1' tickValueDistance='0' " +
                    "majorTMNumber='5' majorTMHeight='4' minorTMNumber='0' showTickValues='1' decimalPrecision='0'" +
                    " ledGap='1' ledSize='1' ledBoxBgColor='FFFFFF' ledBorderColor='666666' borderThickness='0' " +
                    "chartRightMargin='20' background='0' bgColor='FFFFFF' showBorder='0'>" +
                    "<colorRange>" +
                    "   <color minValue='0' maxValue='30' code='00FF00'/>" +
                    "   <color minValue='30' maxValue='50' code='FFFF00'/>" +
                    "   <color minValue='50' maxValue='100' code='FF0000'/>" +
                    "</colorRange>" +
                    "<value>66/value>" +
                    "</chart>";

Then, I tried to set the widget's FCDataXML to my string and rendered the widget. Setting Widget's data and rendering

threatLevelWidget.FCDataXML=xmlData;
threatLevelWidget.FCRender();

Widget...

   <components:FusionWidgets id="threatLevelWidget" FCChartType="HLED" x="10" y="-20" width="510" height="100"/>

I was hoping to see the chart load up with value = 66 but all I get is "Error in loading data". :-/

Any idea what's going wrong!

4

1 回答 1

0

请用 :

threatLevelWidget.FCSetDataXML(xmlData);

不要使用 :threatLevelWidget.FCRender();如果使用 FCSetDataXML() 函数。

于 2011-10-04T19:41:21.033 回答