RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Build a Better Charting Engine Using Flash and XML

When you need to display data as charts in a Web app, forget about precompiled DLLs, assemblies, and expensive third-party components. This article will teach you how to use Flash MX to take data from any server-side script and render it in sleek-looking, animated charts.

hen you think of the phrase "charting on the Web", you probably think of COM components, .NET assemblies, or extensions (like Office Web Extensions). While these are great ways to chart your data, they do put a strain on the system when you need to chart data for thousands of concurrent users. They also come with installation hassles and high-priced licensing policies. You might also think of plain "nested-table" HTML charts, but these don't really make a very big impact on the end-user.

There is an alternative solution that combines good aesthetics with rich content. Macromedia Flash can help you create animated, data-driven charts. Flash's built-in scripting support (ActionScript) allows you to deliver great-looking interactive content.

In this article, you'll learn how to build a Flash movie that takes XML data from server-side script (ASP, in this example) and uses it to render an animated column chart. The chart, shown in Figure 1, will be called "Flash Column Chart."

Figure 1. Flash Column Chart: This is the Chart you'll be creating.

Formalities First
This article is geared toward developers who have a working knowledge of ASP or ASP.NET and a basic knowledge of Flash MX and ActionScript (like handling the Flash MX Authoring Interface, Dragging and Placing Form Elements, naming them etc.). Obviously, you'll need Macromedia Flash MX to open and modify the .fla files. Download a Macromedia Flash MX 30-day trial here.

Even if you're a newbie to Flash, you can simply download the support files of this article and use the completed .swf for your charting purposes without having to peep into how this component was made. However, Flash MX has a very lucid and intuitive interface, so it would not take much to get started with it.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date