ChartDirector 7.1 (.NET Edition)

Introduction to Clickable Charts


This section is about clickable charts for web applications. For Windows Forms or WPF applications, by using the WinChartViewer or WPFChartViewer, all hot spots are always clickable and will trigger hot spot events such as WinChartViewer.ClickHotSpot or WPFChartViewer.ClickHotSpot. They are analogous to standard mouse events so will not be discussed further.

ChartDirector uses HTML image maps, comprises of <AREA> tags, to define "hot spots" on the charts. A hot spot is region on an image that acts like a hypertext (the &;lt;A> tag). It can be used as hypertext links, display tooltips, and can have mouse or touch events. Many of the ChartDirector code examples use image maps for tooltip purposes only, with the URL empty. If the URL is non-empty, when the hot spot is clicked, the browser will navigate to the URL.

For Web Forms, it is also possible to use the mouse click to trigger postback events. This is by using a special URL generated with WebChartViewer.GetPostBackURL. With this URL, mouse clicks will trigger a WebChartViewer.ClickHotSpot event on the server side.

ChartDirector can generate image maps for the data representation on the chart (bars for bar charts, sectors for pie charts, areas for area charts, etc.), for the legend keys, title boxes, custom text boxes and axis labels. This allows these objects to be clickable. As the HTML image map is a text string, you can append your own <AREA> tags to the image map to define custom hot spots on the chart.