Chapter 10. Dynamic Charts and Graphs

In This Chapter:

  • Dynamic Images

  • Getting Started with Dynamic Images in ASP.NET

  • The Graph2D Class

  • Using the Graph2D Class

  • Enhancing the Graph2D Class

Over the years, I've written a lot of software that saves statistical information to a database. Right now I'm maintaining some Internet filtering software, and the recorded statistics are an essential part of the application. There's one catch, though. Staff from the human resource department are the ones who need to see the statistics. There is a wide chasm between what technical types, such as network administrators, and the human resources staff can tolerate in terms of document formats. Text-based reports, lists of URLs, and data without explicit relationships just don't cut it outside the realm of IT professionals.

For this reason, I created a graphical reporting class with which I can easily display two-dimensional data. I hear some of you right now: "Why not use Crystal Reports since it's already a part of Visual Studio .NET, and you don't have to create your own class?" Good question. In fact, using Crystal Reports is how I started out.

The version of Crystal Reports I used had a lot of bugs. By the time you read this they should be fixed (I hope). In addition, I didn't have as much control as I wanted. I was constantly asking, "How can I make this look and act exactly as I want it to?" My challenge was kind of like using the databound controls they are easy to use and flexible, but it seems like you have to work really hard to do something that's outside the box.

Another thing about Crystal Reports is that you must pay a licensing fee to distribute it. Depending on your situation, the licensing fee might price you out of the market.

With my graphing class, I was able to provide exactly what the human resource types wanted understandable graphs that clearly depict the relevant information. The graphical reporting class relies on GDI+ (the latest rendition of Microsoft's Graphics Device Interface) to render the data into an image. Using GDI+ to create dynamic images is presented in the next section.

ASP. NET Solutions - 24 Case Studies. Best Practices for Developers
ASP. NET Solutions - 24 Case Studies. Best Practices for Developers
ISBN: 321159659
Year: 2003
Pages: 175 © 2008-2017.
If you may any questions please contact us: