Go to Homepage Contact Us
Chart for .NET Home
Dundas Add-Ons
Detailed Features
Visual Studio 2005
New Features
AJAX Features
Formulas
Why Dundas Chart?
Success Stories
Reviews
Dashboards
White Papers
Dundas Chart Builder
Editions Available
ASP.NET Enterprise
ASP.NET Professional
Windows Forms Enterprise
Windows Forms Pro
Pro vs. Enterprise
Enterprise Benefits
Online Demo
OLAP
Chart OLAP Gallery
General OLAP Features
New OLAP Features
OLAP Whitepaper
OLAP Demo
QuickStart Guide
Pricing / Licensing
Single Copy
OEM / ISV Program
Subscription & Maintenance
Other Dundas Products
Download an Evaluation

 


 

Dundas Chart for ASP.NET: A Short Review

Oh, it all started innocently enough. I've been tracking the downloads on my site for the past few months, but doing it very primitively. I started with a system that merely sent me an email for every file downloaded with the email address of the downloader, which I then routed into an Outlook folder. The idea was that I'd quickly move the data over to a database so that I could run reports. That was three months ago.

The Problem

There were two things keeping me from moving my data to a database. One was my intrinsic cheapness. Because the ISP that hosts my web site charged $10 whole dollars per month to use SQL Server, which I could then query from whatever machine I wanted, I resisted moving to it for just this one little feature (of course, I've had that thought more than a few times so far, so we'll see which "little feature" finally pushes me over the edge). I can use Access for free, but since I can't run remote queries on Access, that requires a download whenever I want to check download stats, which is a pain when compared with the immediacy of my Outlook folder.

The second, more serious problem, is that just shoving the data into a database wouldn't really give me a much better view of the big picture than my Outlook folder did. What I needed was a way to visualize the data, likely with some kind of charts or graphs. Since I didn't have ready (read: "free") access to an ASP.NET charting control that would let me use an Access database on my ISP's server, I was resistant to wasting my time on a charting control that wouldn't have the features I needed. The chance of that happening was further magnified because of my utter lack of experience with any kind of charting control whatsoever, so I didn't even know what I needed.

The Dundas Solution

Luckily, David Cunningham, from Dundas Software, came along to offer me a copy of his company's charting control, into which I stepped my toe with some trepidation. I needn't have worried. Not only was the Dundas chart more than full-featured enough, but the documentation was definitely geared towards getting a charting newbie started fast. In an afternoon, I was able to create an interactive download reporting page that showed me the top 10 downloads from my site (as shown in Figure 1), and allowed me to drill into the download details for any file (as shown in Figure 2).

Figure 1: Top 10 Downloads

Figure 2: Download details for a specific file

Setup and Documentation

Installation was a breeze; simply a matter of entering your user name and password and pressing the OK button a few times. When I started a new ASP.NET web application from VS.NET to build my reports, the Dundas chart was right in the toolbox where I expected it to be, ready to drag and drop into use. Likewise, the documentation was integrated directly into VS.NET via F1 help when I needed reference information. Even better, the sample project documentation gave me a big leg up. In fact, when I needed a charting feature, I looked for samples in the various categories, e.g. Populating Data, Working with Dates and Interactive Charting, and pulled code to implement what I was after. Each sample provided a nice explanation, an interactive chart that let me test various options and a concise code snippet highlighting the specific code to use for that feature. Sometimes there was more code in the sample then there should have been, e.g. a long function called SetAxisInterval that really belonged in the control itself, but even when this happened, the reusable code was separated into a separate function suitable for dropping into my project. Frankly, while I hate to gush and ruin my reputation as a hard-nosed pundit, the chart sample documentation was a model that I wish other control vendors would follow. It was the most important piece in helping me figure out how to navigate the features and complexity of the chart control.

Providing the Data

The chart control takes data in several different ways, including entering data directly into the control via the VS.NET Property Browser, adding the points programmatically or using data binding, either via a data reader or a dataset. Charts themselves are allowed multiple areas, each area has one or more series of points. It's the points in the series that are charted in some particular style of chart, e.g. pie, line, bar, column, donut, and a ton of others. Unfortunately, there isn't a way to set a data source at design-time, like you can on a DataGrid control. That has to be done programmatically. Also, there's no way to produce a 3D chart, but according to their support personnel, that's coming in a future version.

For the top 10 list of downloads on my site, I used a custom data structure which I calculated from a cached dataset. Populating this series was a matter of calling the AddXY method to the Points collection on the series:

void ShowTopN() {

	Series series = _chart.Series["Default"];

	foreach( FileTotal fileTotal in _topN ) {

		series.Points.AddXY(fileTotal.File, fileTotal.Total);

	}

}

For the details of a specific file, I used the cached dataset as the data source using the DataBindXY method on the Points collection:

void ShowSingleFile(string file) {


	// Get the selected file total


	FileTotal fileTotal = (FileTotal)_fileTotals[file];




	// Set the view to filter by file name


	DataView view = _byFileDataset.DownloadsByFileQuery.DefaultView;


	view.RowFilter = string.Format("DownloadFile = '{0}'",

		fileTotal.File);


	// Set the series to be populated by the view
	
	Series series = _chart.Series["Default"];
	
	series.Points.DataBindXY(view, "DownloadDay",
	
		view, "DownloadCount");

}

Interactivity

Of course, the charts were pretty (I didn't show the code to set all manner of titles, labels, decorative frames, backgrounds, etc), but my favorite feature was easily the interactivity. As you probably know, HTML allows arbitrary areas of a graphic to be set as "hot spots" on which to handle events via a mechanism known as a "image maps". If I wanted each series in my pie chart to be a clickable hot spot to allow for drilling into the details, I could have dynamically created HTMP image maps that would look like this:

<MAP NAME="_chartImageMap"> 

<AREA SHAPE="poly" HREF="?file=comdate.zip" Title="comdate.zip: 4.31 % (204)"
COORDS="344,217,434,192,435,198,436,204,437,211,437,217">

� 

</MAP>

Of course, that's a giant pain, so instead, I just set a couple of properties on my pie chart and let the control generate the image maps behind the scenes:

// Set the series properties


Series series = _chart.Series["Default"];

series.ChartType = "Pie";

series.ToolTip = "#VALX: #PERCENT (#VAL)";


// Add the data to the series

foreach( FileTotal fileTotal in _topN ) {

		int pos = series.Points.AddXY(fileTotal.File, fileTotal.Total);

		series.Points[pos].Href = "?file=" + fileTotal.File;

	}

}

All I had to do was set the Href property on each point to have an image map entry automatically generated. And, just for fun, I added a tooltip on the series as a whole using the ToolTip property and the chart's variable expansion language, e.g. #VALX is the value for X at a given point, #VAL is the value of Y at a given point and #PERCENT is the Y percentage of the whole. To handle the interactivity, I just had to check the file argument in the QueryString property during the Load event as I normally would in any ASP.NET application:

void Page_Load(object sender, EventArgs e) {

	...



	string file = Request.QueryString["file"];

	if( !Empty(file) ) ShowSingleFile(file);

	else ShowTopN();

}

Deployment

Deployment worked just as I expected it to, with the chart control being uploaded appropriately. However, there was one slight snag. Since the chart control creates JPEG files on the fly to serve up to clients, my web application needed write access to the file system, which, by default, the ASP.NET worker process does not have. That's not a problem on my local machine, where I have complete control and can easily follow the instructions provided by Dundas to grant appropriate permissions. However, since I use an ISP to host my public web site and don't have direct administrative control to that machine, it was kind of a problem. I would have been really great if the Dundas web site had a page listing these instructions so that I could just send my ISP an URL.

Support

As good as the documentation was, I still had a few questions along the way, so I sent them off to support@dundas.com. Even though I didn't like all the answers, e.g. no 3D charts, they were prompt, complete and mostly correct (there was a bit of a problem with exactly how data binding works with DataGrids in comparison to how I thought it should work with individual series on the chart control). Overall, it was much better than the support I've tried and failed to get from other companies in the past.

Problem Solved

As I mentioned, I haven't tried another charting control, either for WinForms or for WebForms applications. However, with the results I got using the Dundas charting control, I don't anticipate the need to go anywhere else.

Disclosure

Dundas Software provides some discount advertisement for Sells Brothers, Inc, the employer of this reviewer.