Friday, August 15, 2008

Inverting a Chart Series

You can plot multiple data series on a chart directly on top of each other, or by stacking them. Another way to plot them is by inverting one of the data series so that it is drawn upside down below the horizontal axis.

In the example below I used an AreaChart with two AreaSeries representing the data. You can use the dataFunction property of the series to tell Flex how to render the data. In this case I negated one of the series so it would be drawn below the axis. I also used the labelFunction property of the vertical axis to make sure that labels would be printed with positive values.

Right click on the example below to view the source.

1 comment: