tags:

views:

89

answers:

2

I have a Line Series Chart in Flex with values from 0 to 90. I would like to set the background of the chart in such a way that, 0 - 30 is in green, 31 - 60 is in red and 61 - 90 is in blue.

I am new to Flex. Can someone tell me how this can be done?

A: 

the easiest way to do this would be to set the graphs maximum and minimum to fixed values(so that it doesn't auto re-size) and draw the color bars behind it using the normal drawing api.

greg
A: 

There is a class called 'CartesianDataCanvas' that is designed for this kind of thing. You add an instance to the chart's 'backgroundElements' and use a drawing API to draw on it. What is handy is that the drawing API on these objects works in terms of data coordinates, not screen coordinates saving you a lot of converstion work and making scaling and resizing much easier.

More here: http://livedocs.adobe.com/flex/3/html/help.html?content=charts%5Feventsandeffects%5F13.html

stephen