Magazine
 
Quick Review:Ajax
 
Ajax and XML: Five cool Ajax widgets

<string>2006</string>
</row>
<row>
<string>Projected</string>
<number>500</number>
<number>700</number>
</row>
<row>
<string>Actual</string>
<number>600</number>
<number>900</number>
</row>
</chart_data>
</chart>

This file is primarily the data for the chart, along with some optional visual information. In this case, I’m specifying the chart type as a bar chart. The site from which I downloaded the SWF file has a lot more on the options you can set and the types of graphs that are available.

When I browse to the file in my Firefox browser, I see the graph shown in Figure 1.

Figure 1. The Chart Widget in action

As you can see, the default color scheme and the look of the chart is really slick. And the graph does the right thing of rounding up the axis values nicely. The overall effect is great with little effort on my part.

Obviously, you could replace the graph_data.xml file with a dynamic Web page: As long as the returned data is in the correct format, the graph control cares less. This is the case with all the examples in this article. In fact, you can run all the examples in a Web browser on local files without using a Web server (such as Apache Tomcat or IBM® WebSphere® Application Server) or Web programming language (for example, PHP, Microsoft® ASP.NET, Java™ 2 Enterprise Edition [Java EE]).

Apr 2008 | Java Jazz Up | 49
 
previous
index
next
 
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70, 71, 72, 73, 74, 75, 76, 77, 78,   Download PDF