MSChart - Drilldown Charts: Part I

Using the GetCallbackEventReference method of the ClientScriptManager class.

Source code with two MSChart controls (Chart1 and Chart2). We start by creating a simple chart (Chart1) plotted using random numbers. While clicking a Series on Chart1, another chart (or a drill downed chart - Chart2) will show with Chart1 Series point value.

On Page Load following things happening:

1. Applying color for Chart1 Series, later using for Chart2 Series.

2. Plotting Chart1.

3. Setting onclick event attributes for Chart1 Series, will pass Series Name, Point Value, Series Color.

series.MapAreaAttributes = "onclick= \"" + sHandler + "\"";

Also, can use onmouseover, onmousedown, ondblclick etc...

4. Registering a JavaScript function named UseCallback(), which will used for calling server side code from client script for plotting Chart2.

Download the sample pages with images from above link.

Page Load - Chart1:

Onclick - Chart1:

Chart2 plotted:

Please post comments about this article.

My other articles will help you in creating charts using database interaction, refer links: