MapArea Class

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Represents a map area.

Namespace:   System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

type MapArea = 
        inherit ChartNamedElement
        interface IChartMapArea


Initializes a new instance of the MapArea class.

System_CAPS_pubmethodMapArea(MapAreaShape, String, Single[])

Initializes a new instance of the MapArea class with the specified shape, URL and coordinates.

System_CAPS_pubmethodMapArea(MapAreaShape, String, String, String, String, Single[], Object)

Initializes a new instance of the MapArea class with the specified shape, tooltip text, URL, attributes, postback value, coordinates and tag.

System_CAPS_pubmethodMapArea(String, GraphicsPath)

Initializes a new instance of the MapArea class with the specified URL and GraphicsPath object.

System_CAPS_pubmethodMapArea(String, RectangleF)

Initializes a new instance of the MapArea class with the specified URL and RectangleF structure.

System_CAPS_pubmethodMapArea(String, String, String, String, GraphicsPath, Object)

Initializes a new instance of the MapArea class with the specified tooltip text, URL, attributes, postback value, path and tag.

System_CAPS_pubmethodMapArea(String, String, String, String, RectangleF, Object)

Initializes a new instance of the MapArea class with the specified tooltip text, URL, attributes, postback value, rectangle coordinates and tag.


Gets or sets the coordinates of a MapArea object.


Gets or sets a value that indicates whether the map area is custom.


Gets or sets the attributes of the map area.


Gets or sets the name of the map area.(Overrides ChartNamedElement.Name.)


Gets or sets the postback value which can be processed on a Click event.


Gets or sets the shape of a MapArea object.


Gets or sets an object associated with this chart element.(Inherited from ChartElement.)


Gets or sets the tooltip for the map area.


Gets or sets the destination URL or anchor point of the map area.


Releases the resources used by the ChartElement.(Inherited from ChartElement.)


Releases the unmanaged resources used by the ChartElement and optionally releases the managed resources.(Inherited from ChartElement.)


Determines whether the specified Object is equal to the current ChartElement.(Inherited from ChartElement.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Returns a hash function for a particular type.(Inherited from ChartElement.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Returns a string that represents the current Object.(Inherited from ChartElement.)

The MapArea class represents a map area of a client-side image map, and corresponds to an HTML <AREA> tag.

The MapArea objects are stored in the MapAreasCollection class.

There are two types of MapArea objects:

  • Map areas that are automatically created when a chart element—for example, a data point, series, legend item or strip line object—has a non-empty ToolTip, Url or MapAreaAttributes property; note that other HTML elements that are required for a client-side image map are also created. In this case, the dimensions and location of a map area are automatically determined by the chart element. Use the CustomizeMapAreas event of the root Chart object to delete or modify these map areas at run time.

  • Custom map areas that have a user-defined shape and coordinates. Use the MapAreas property of the Chart object to add these custom map areas at design time or run time.

Setting this property will have no effect if the IsMapEnabled property is set to false. The default value is true.

Important   To create an image map using the previously described MapArea objects, the RenderType property of the Chart object must be set to ImageTag. It is possible to create an image map when using binary streaming, but another technique must be used.

For custom MapArea objects, the Shape property determines the shape, and the Coordinates property determines the location of the map area.

Tooltips, hyperlinks, or attributes, such as Target=_Blank or OnClick="javascript:MyJavaScriptFunction()", can be set for all map areas.

Use the IsCustom property to determine whether a map area is a custom MapArea object; that is, whether it has user-defined shape and coordinates.

.NET Framework
Available since 4.0

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top