This demo has been created to illustrate how to use Chart within your Map. Dundas Chart can be placed on your map as symbols, in the legend, or as images in the map's Images collection. In the image below, Dundas Chart is used to draw a pie chart for each province in the map of Canada:

This demo requires Dundas Map and Dundas Chart for ASP.NET. (You can also place Dundas Gauge on the Map using the same procedure.) Dundas controls have a rendering method called "Binary Streaming", which allows them to render an image as the aspx page response.
There are two aspx pages to make this happen:
- MapChart.aspx: This page has nothing on it except a Dundas Chart control - absolutely all HTML elements are removed from the aspx page markup, leaving only the <DCWC:Chart> tags and the <@ Page> and <@ Register> declarations. The BackColor is set to Transparent for being placed on the map.
The chart control's RenderType property is set to BinaryStreaming, so that when this page is requested, the response itself is a chart image file.
The code-behind for this page accesses three values from the request URL and plots them on the chart control.
- Map.aspx: This page has a map control on it containing shapes for the provinces of Canada. The code-behind for this page creates a symbol for each province, and each symbol has its Image property set to refer to MapChart.aspx along with three values as request arguments to be plotted on the chart. (The reference to MapChart.aspx must be a full URL so that the page is accessed from IIS.)
A symbol rule is not necessary for displaying charts as symbols, but can be used to give symbols varying sizes depending on a field value. A symbol rule is also used here for the field with sales numbers for 2005. This symbol rule has three predefined symbols added, each with a progressively larger size, so that the higher the sales numbers are for a province, the larger its chart symbol. (For more information on symbol rules, see "Symbol Rules" in our documentation.)
The pie image for the legend in this sample website was created ahead of time, but you could also use a second binary streaming Chart on another aspx page to generate this image dynamically.
You can also easily generate other chart types. Here is another screenshot where the chart type was set to Column:

Getting started
- Download the project or website for the appropriate version of Visual Studio
- Re-add references to DundasWebMap.dll and DundasWebChart.dll, which are located in the "bin" subfolder of the Dundas Map and Dundas Chart installation folders.
- Build the project/website and run it
- If you have an evaluation copy of Dundas Chart, the evaluation watermark will display as thick black text over the transparent areas of the chart images, but this will not occur using the full version. (See the screenshot at the top of this article.)
|
| |