Charting Example

english mobile

A couple of weeks ago, I said I'd compile some thoughts about charting. Normally, this would mean that I'd talk about charts in a general way. I'm not much on posting code, mainly because I'm terrified that I'll post something that will lead someone who's even more newbie than I am down the wrong path. Instead, I prefer to talk about code in general terms, then let people go off and make whatever mistakes I've inspired them to while I keep a clean conscience.

But this week someone asked me to give an example of showing how to add an axis in ActionScript, so I thought I'd do that just this once because my husband just had shoulder surgery and goes to bed early these days. While I was at it, I threw in a little bit of this and that other stuff I'd learned while building charts.

I don't claim my approach is the only approach or the best approach to the problem. But here's an example of how to create a chart entirely in ActionScript. Right click to view source. If you pick up bad habits from it don't blame me!!!


chad said...

February is showing up twice on the haxis, but the data for both of the February XML nodes is showing up in the second February vertical series. How can you get this to only show February once but still show all February data?

Amy B said...

Thanks for calling this to my attention. The reason that there are two data points for February is that I mistakenly put in two "February" nodes. It wouldn't make sense to have a second set of data for each series in February without having an additional point along the horizontal axis. The lines would have to split, and they can't do that.

chad said...
This comment has been removed by a blog administrator.
Amy B said...
This comment has been removed by the author.
Sumeet Mahajan said...

My query is related to Line Chart in Flex. I dont know whether anyone has come across such a problem before or not. I want to show the data points of a single line in different formats.

For Example I have a Data Series being shown on a Line Chart. This data series has say seven data points. Out of these seven data points, I want to show 4 data points in Red color and the other three data points in green color.

Can anyone suggest some solution for this

thanks and regards