O'Reilly logo

ActionScript Graphing Cookbook by Peter Backx, Dominic Gélineau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a treemap

In this recipe we are going to build a treemap. Treemaps are used to represent the data structure of a tree (nodes that have nodes as children). In this example, we are going to use it more as a rectangular pie chart. Wherever you can use a pie chart, you will be able to use this treemap, but it will give you the ability to use something a bit different.

Creating a treemap

Getting ready

Open the files in the Treemap folder in the downloadable code files from www.packtpub.com.

How to do it...

  1. Let's start by creating the data structure that is TreemapData.as:
    public var color : uint; public var percent : Number; public var label:String; public function ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required