Minimal Charts!

Mar 19 2010 Published by under ActionScript, Components, Flash

Send to Kindle

I have an idea in mind for an app. It needs charts. Therefore, we now have minimal charts.

First is the Bar Chart and Line Chart:

Get Adobe Flash player

And then the Pie Chart:

Get Adobe Flash player

Coming soon, the Rubber Chicken Graph. (Name that comedian.)

Each chart takes an array passed into its data property. For Line and Bar charts, this is an array of Numbers. These two charts are set to autoScale = true by default. But you can set that to false and provide minimum and maximum values. Set showScaleLabels to true to show the max and min values in labels off to the left as in the examples. The labelPrecision property can be used to determine how these are rounded off if necessary. The Bar Chart’s bar colors can be specified with barColor, and the Line Chart’s lines can be customized with lineColor and lineWidth.

In the Pie Chart, you can also pass an array Numbers to data, or you can pass an array of Objects, where each object has a value property, and optionally a label and color property. If no label is provided, the value is used as a label, rounded off again using labelPrecision. If you don’t want any label, pass in an empty string. If no color is provided, each pie slice will use predetermined color values. You can also pass in an array of color values to the colors property to use those instead. If you run out of color values, random colors will be assigned. Sorting of your data needs to be done manually, if you want the slices to appear in order of size. By default, the first slice starts at an angle of zero degrees. You can change this with beginningAngle, which is in degrees. There is no limit to the number of slices you can have, but too many will make the labels overlap. And more than that, you won’t even be able to see the smaller slices. There is no consolidation or hiding of tiny slices. That’s up to you to handle by tweaking your data first.

http://www.minimalcomps.com

Send to Kindle

7 responses so far

Leave a Reply