Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
Solerous #1
Arraycollection conversion to chart data
I'm trying to get ArrayCollection mapped to an array using the Blazeds turnkey
sample code. In the sqladmin example, they are creating a List object in the
Java code by executing the SQL query and storing it like this:
// relevant code...
while (rs.next()) {
row=new HashMap();
for (int i = 1; i <= colCount; i++) {
row.put(rsmd.getColumnName(i), rs.getString(i));
}
list.add(row);
}
}
Then they put this result in a dataGrid:
<mx:DataGrid id="dg" dataProvider="{resultSet}" width="100%" height="100%"/>
and the following method.
private function resultHandler(event:ResultEvent):void {
resultSet = ArrayCollection(event.result);
}
I'd like to display the same data in a chart, but I don't know how to do this.
What I'd like to do is something like this:
//pseudo code
Horizontal Axis (x) = Data from Column 1
Vertical Axis (y) = Data from Column 2
..or something like that. Anyone know what class the HashMap/List is sending
back so that I can convert the info into Dates or numbers or somethow get it to
show up on the chart?
I was trying something like this, but it doesn't work:
var axisArray:ArrayCollection = new ArrayCollection;
for each (var obj:Object in resultSet) {
var f:Number = new Number(obj);
result.addItem(f);
}
// axis data provider = axisArray
Solerous Guest
-
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... -
MS Excel Chart Conversion problem
I have used "Paste Special" then Paste as a Picture (Metafile) to insert Excel charts into a number of MS Word documents. PDF files are being created... -
Pantone colors to RGB conversion chart or palette?
What is the best method to get the RGB color equivalent numbers from a Pantone color/number. Is clicking on a Pantone color from a palette/swatch... -
012 and 015 eq \r and\n on what conversion chart?
tr/\012\015//d; So a while back ago, there was someone kind enough to pass me the above snippet of code, which removes returns and newlines from... -
RBG to CMYK Conversion Chart
Not to mention that there are 16.7 *million* colors possible in RGB. That would be some long "chart" :-) Mac -
Gaurav J #2
Re: Arraycollection conversion to chart data
You need to add series to your chart and then assign the data to the series.
I recommend looking at
[url]http://www.quietlyscheming.com/blog/charts/chart-sampler/[/url]
and the charting documentation and examples.
Thanks,
Gaurav
Gaurav J Guest
-
Solerous #3
Re: Arraycollection conversion to chart data
yes, it seems that I was messing up in assigning the results to the various
axis definitions. I assumed the data wasn't there, but it really was. I
didn't need this loop at all:
var axisArray:ArrayCollection = new ArrayCollection;
for each (var obj:Object in resultSet) {
var f:Number = new Number(obj);
result.addItem(f);
}
just assigning the data correctly:
series1.dataProvider = resultSet;
series1.xField="TIME";
series1.yField="VALUE";
Thanks for the help!
Solerous Guest



Reply With Quote

