ComponentOne Chart for .NET (2.0) Search HelpCentral 

Defining the MapArea Properties and Keywords

Each MapArea object contains the following properties that define how the image map will respond to end-user interaction.

Property

Description

.Attributes

Specifies additional attributes for the <area> tag in the image map.

HRef

Specifies the URL to link when the corresponding chart object is clicked.

Shape

Gets or sets a shape for the MapArea.

Tooltip

 Specifies the text to show when mouse pointer is over the element.

If none of these properties are set, then the MapArea will be excluded from the resulting image map.

The following example creates a new area and sets its Tooltip and a HRef property, turning the area into a hyperlink:

map.Tooltip = "Go to C1 home page";

map.HRef = "http://componentone.com";

You can also use the MapArea.Attributes property to attach JavaScript event handler to areas:

map.Attributes = "onclick=window.open('url.com')";

In fact, the Attributes property can be used to add any attributes to the map <area> of a chart element, including an ID, TITLE, TARGET or anything else you wish. The enter string specified by the Attributes property is embedded within the <area> tag for the chart element.

If all of the ImageAreas elements are empty, then at run time, the ImageAreas collection will appear empty, i.e. – the Count will be zero. However, build in map areas can still be accessed and automatically added to the collection by retrieving them by name. For example, to retrieve the header element,

MapArea map = C1WebChart1.ImageAreas.GetByName("Header");

map.Attributes = "onclick=window.open('url.com')";


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.