explorers' club

explorations in dev, science, sci-fi, games, and other fun stuff!

Conditionally Colored Flex Charts – simplified

2 Comments

[Another quick note to myself]

I have always thought of flex developers as being categorized in two camps (at least this has been my experience).  You have the:

  • those who focus on mostly Flex charting and
  • those who focus on everything but Flex charting.

I fall into the latter category.  I just never decided to look into charts.  Everytime I would take a peek at the API I would just shake my head in confusion and focus on other tasks.  Why learn something new today that you can put off till tomorrow (or however that saying goes).  Well a client wants charts and I am the only Flex developer on the project.

Here is a basic breakdown of what the UI is expected to have:

  • comparative data showing columns, each column representing an individual item of like-type.
  • unique colors per item.
  • color will also indicate some status compared to a benchmark indicator.

The idea is to achieve something like this:

Whoo hoo, big deal.  Just another column chart.  Anywho…. so the issue was I was trying to find a way to easily color the columns based on certain conditions ergo a conditionally colored column chart.

I ran across this post (link) where someone had created a ChartItemRenderer subclass.  It seems to work brilliantly, but I had to question if there was not some simpler means to do so.  After much poking around I did indeed find it.  Check out mx:ColumnSeries.fillFunction (link).

About these ads

2 thoughts on “Conditionally Colored Flex Charts – simplified

  1. Pingback: Bookmarks about Basic

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.