Chapter 16. Converting Data to Charts: Displaying Data

In This Chapter:

  • The DataToGraph Application

  • Using the Graph2D Class

  • The DataToGraph Code

  • Deploying the Application

  • Extending the Application

Showing data inside a bar graph is a great way to let users easily understand overall trends. Even technical people don't want to look through log files to analyze data. Everyone wants to take one look at a bar chart to get an overall the idea of what a dataset represents.

We spent a good deal of time displaying data in bar charts in Chapter 10. A class named Graph2D was used in Chapter 10 to take data and render at as a bar chart. A description of how to use the Graph2D class is given in Chapter 10. But this chapter goes a lot further than Chapter 10 and shows how to manipulate data before it is rendered as a bar graph.

You are probably wondering why data needs to be manipulated before it is rendered. There are a number of reasons why this might be so. The data values might have a small variation and their values are far from zero. In this case, you might want to adjust the data by subtracting a value from each of the data values so that the variation in the data is more pronounced and therefore makes trends easier to identify.

You might also want to take advantage of the capability to present data in such a way that it appears to support practically any conclusion. Exaggerating fluctuations, normalizing fluctuations, and performing any number of mathematical operations on the data can be done to alter its appearance. You know the saying: There are lies, damned lives, and statistics.

This chapter uses the Graph2D class from Chapter 10, but here we perform mathematical operations on the dataset before they are graphed. This will give you a good idea of what is possible if you plan to use the Graph2D class from Chapter 10.

Table 16.1. The Methods for the DataToGraphCS Application

Method

Listing

Source Code File

Description

Page_Load()

16.5

Default.aspx.cs

This method initializes the user interface objects, such as the list of cities.

Graph_Click()

16.6

Default.aspx.cs

This method creates a graph based on the unaltered data.

GraphAndClick_Click()

16.7

Default.aspx.cs

This method creates a graph based on the sorted data.

Predict_Click()

16.8

Default.aspx.cs

This method creates a graph that includes two additional predicted values.



ASP. NET Solutions - 24 Case Studies. Best Practices for Developers
ASP. NET Solutions - 24 Case Studies. Best Practices for Developers
ISBN: 321159659
EAN: N/A
Year: 2003
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net