Data Based Renderers

There’ve been a couple of questions on the Flex lists lately about how to write custom renderers that draw a chart item differently based on the value it’s representing. I plan to flesh this out more over time, but to start off, here’s an example of a PieChart that renders its wedges with different colors based on whether the value they represent pass a particular threshold.

A couple of notes:

And, while clearly I have a bit of an advantage, I threw this example together in the past 25 minutes or so. So take heart that once you get your hands dirty, extending charts can be fast and effortless ;)

* Threshold based Pie Chart

* view source

* download source

Feedback or thoughts on this example, as well as requests for other examples you’d like to see, are much appreciated. Leave comments, suggestions, criticisms here.


Categories