rishin.goswami
-
Content count
6 -
Joined
-
Last visited
Posts posted by rishin.goswami
-
-
It is necessary to synchronize return events from remote calls and the FCRendered event of the chart. This is because the methods exposed by the FusionCharts object aren't available until it has fired the FCRenderEvent event. The diagram below is an ideal case where the FCSetDataXML method is invoked after the FCRenderEvent event has fired. For practical cases however, the method may just be invoked before chart has rendered and would thus fail.
The solution
The ideal solution would be to create the chart dynamically after the result is received by Flex. Architectural considerations however will not always allow this model. So the task of synchronizing the two events comes into being. In the code below we have done just that.
Notice that we have decalred a FusionCharts and a HTTPService object in the code. Also, the HTTPService is invoked when the creationComplete event of the application is fired.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="com.fusioncharts.components.*"<![CDATA[
import mx.rpc.events.ResultEvent;
private var hasRendered:Boolean = false;
private function onResult(e:ResultEvent):void {
dataXML = e.result.toString();
setData();
}
private function onRender():void {
hasRendered = true;
setData();
}
private function setData():void {
if(hasRendered) {
fc.FCSetDataXML(dataXML);
}
}
]]>
The FCRenderEvent of the chart calls upon the onRender method. This method sets the hasRendered flag true and calls upon setData method. Parallely the result event of the HTTPService object invokes the onResult method. This method caches the resultant data and also calls upon setData method.
The setData method checks if the chart has rendred and then sets the data. Thus no matter which event eventually triggers the setData method first the chart data will always be set to the remote data.
-
I give her whatever the program prints,
public static void main(String[] args) {
System.out.println(srividiyasScore());
}
private static double srividiyasScore() {
try {
return srividiyasScore();
} catch(Error e) {
return srividiyasScore();
}
}
PS. it prints 10
-
Hi,
You can solve your problem by encoding the chart XML file with a byte order mark (BOM). To get your sample application running, please replace the DataXML.xml file with the one provided here. You can learn more about using UTF-8 chracters in FusionCharts for Flex in the documentation at Special Cases > Multilingual Characters in Charts.
pie chart style & addtional info
in General Usage
Posted · Report reply
Hi,
Unfortunately the Pie3D chart does not support any styles for the DATAPLOT objects. You can see the list of supported styles at http://www.fusioncharts.com/docs/Contents/ChartSS/Pie3D.html#Objects.
The charts do not provide any other means of providing information. You can provide additional information for widget types using annotations. Optionally, you can use the absolute layout mode in Flex and put a TextArea component over the chart.