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

Making 3D bar charts

In the recipe Building vertical bar charts in this chapter, we showed how to make a simple bar chart in ActionScript. For this recipe, we wanted to spice it up a bit and make it 3D.

Making 3D bar charts

Getting ready

Get the code from the Building vertical bar charts recipe.

How to do it...

The following steps will show you how to convert a 2D bar chart to 3D:

  1. Take BarData.as, HorizontalAxis.as, VerticalAxis.as, and Main.as from the Building vertical bar charts recipe from this chapter; these files are not going to change.
  2. Now in BarChart.as, increase the space between the bars. These are the lines that change:
    _barWidth = (width - 10) * 70 / 100 / data.length; ...

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