Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
kohinoor75 #1
Chart with http data does not work
I try to create a chart with live http data.
I cannot figure how to make the chart appear correctly.
With the same code, if I bind statically the XML generated by my servlet, it
works fine.
However, with live data, it does not. I know that my servlet is called, but I
suspect that it is called too late maybe.
Here is the code :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
initialize="retrieveData()">
<mx:HTTPService id="inventory" contentType="application/xml" method="GET"
protocol="http"
url="getInventory" fault="trace(event.fault.faultstring)"
resultFormat="object">
</mx:HTTPService>
<!-- <mx:Model id="results" source="chartdata.xml"/> -->
<mx:Script>
<![CDATA[
var objkey : String ;
var results ;
function retrieveData( )
{
inventory.url = "getInventory?objkey=" + objkey ;
inventory.send() ;
}
]]>
</mx:Script>
<mx:ColumnChart id="chart" width="100%" height="100%"
dataProvider="{inventory.result.objectClass}" showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{inventory.result.objectClass}"
categoryField="name"/>
</mx:horizontalAxis>
<mx:series>
<mx:Array>
<mx:ColumnSeries yField="count"/>
</mx:Array>
</mx:series>
</mx:ColumnChart>
</mx:Application>
And here is XML data:
<data>
<objectClass name="File-Assignments">
<count>16430</count>
</objectClass>
<objectClass name="Phys-Files">
<count>9668</count>
</objectClass>
</data>
kohinoor75 Guest
-
Chart Hit Data
I've got an issue with a chart control which is positioned far right on the screen of a dashboard. When hovering over a column data series, the... -
Refreshing chart data doesnt update chart
I must be missing something simple here. I have a column chart that is using an array for its dataprovider. However, when I update the underlying... -
Help grouping chart data
I have a line chart with each axi defined as follows; x is defined by time, and y is defined by bytes. My issue is the data is coming across for two... -
Updating the data on a Chart
Hi, I'm trying to invalidate the data of a Chart by calling invalidateData (which is defined in ChartBase and supposedly inherited in PieChart,... -
Chart from SQL-server data
Hi ! I'm new to asp. I have made a page to display a chart based on data from my SQL-server. I have used Office Web-component graph. Here I can... -
ntsiii #2
Re: Chart with http data does not work
I don't think you can include parameters on the url. Instead, use a request
object, like this:
inventory.url = "getInventory";
inventory.send({objkey : objkey }) ;
Binding problems are difficult to debug so I always first use a reault handler
called by the data services result event. In that handler function I can rais
an alert to make sure the data callis returning and then I can inspect the
contents of the result object to verify is structure.
And once I have done that, I usually just assign the result.whatever to the
dataProvider.
Tracy
ntsiii Guest



Reply With Quote

