Be the first to write a review
Building a bar chart in Flash, part 1
I get a lot of queries from people about how to create charts in Flash. Flash MX shipped with some chart components and there are a number of commercial products available that can help you make charts. However, if you need to make a simple chart, you can quite easily write your own. That’s the topic for this tutorial.
In this tutorial, I’ll show you how to create your own reusable BarChart class. We’ll draw the axes and bars with the drawing API. We’ll allow users of the class to create it with default values and labels or set their own. We’ll also allow people to add their own title and bar colour. If you’re not familiar with the drawing API, I won’t cover it in detail here so if you need a refresher, check out the Drawing with Flash article.
Note: If you have difficulties downloading the source files or PDF, you might have a problem with your cookies. Delete the cookies from your machine and try again. In Internet Explorer, you can do this by choosing Tools > Internet Options… and clicking the Delete Cookies… button on the General tab.
Sas Jacobs
Hello. I'm the Principal of Anything Is Possible, an Australian web development business specialising in web applications development and training. I'm interested in using Flash with dynamic content and I've presented at a number of International conferences on topics relating to applications development, XML and scripting components. I have recently released my second print book Beginning XML with DOM and Ajax to match the first one - Foundation XML for Flash. I have a business web site
and a personal web site.