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 3D column chart

Now that we know how to draw a cube in 3D, it's time to convert that cube into a bar and draw a 3D bar chart. To keep things simple, we'll start with just one set of data.

Getting ready

Start by creating a new Main class inside a new package. We'll start from a setup similar to the previous recipe. For now, we've left out the mesh definition and the camera setup, as these will differ:

package com.graphing.graph { import away3d.containers.View3D; import away3d.lights.DirectionalLight; import away3d.materials.lightpickers.StaticLightPicker; import com.graphing.Graph3D; import flash.display.Sprite; import flash.events.Event; public class Main extends Sprite { private var _view:View3D; private var _data:Array = [[0,20],[50,70],[100,0],[150,150],[200,300],[250,200],[300,400],[350,20],[400,60],[450,250],[500,90],[550,400],[600,500],[650,450],[700,320]]; ...

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