Export (0) Print
Expand All

MapArea Class

Represents a map area.

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

public class MapArea : ChartNamedElement, IChartMapArea

The MapArea type exposes the following members.

  NameDescription
Public methodMapArea()Initializes a new instance of the MapArea class.
Public methodMapArea(String, GraphicsPath)Initializes a new instance of the MapArea class with the specified URL and GraphicsPath object.
Public methodMapArea(String, RectangleF)Initializes a new instance of the MapArea class with the specified URL and RectangleF structure.
Public methodMapArea(MapAreaShape, String, Single[])Initializes a new instance of the MapArea class with the specified shape, URL and coordinates.
Public methodMapArea(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.
Public methodMapArea(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.
Public methodMapArea(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.
Top

  NameDescription
Public propertyCoordinatesGets or sets the coordinates of a MapArea object.
Public propertyIsCustomGets or sets a value that indicates whether the map area is custom.
Public propertyMapAreaAttributesGets or sets the attributes of the map area.
Public propertyNameGets or sets the name of the map area. (Overrides ChartNamedElement.Name.)
Public propertyPostBackValueGets or sets the postback value which can be processed on a Click event.
Public propertyShapeGets or sets the shape of a MapArea object.
Public propertyTagGets or sets an object associated with this chart element. (Inherited from ChartElement.)
Public propertyToolTipGets or sets the tooltip for the map area.
Public propertyUrlGets or sets the destination URL or anchor point of the map area.
Top

  NameDescription
Public methodDispose()Releases the resources used by the ChartElement. (Inherited from ChartElement.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the ChartElement and optionally releases the managed resources. (Inherited from ChartElement.)
Public methodEqualsDetermines whether the specified Object is equal to the current ChartElement. (Inherited from ChartElement.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns a hash function for a particular type. (Inherited from ChartElement.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current Object. (Inherited from ChartElement.)
Top

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

Supported in: 4.5.2, 4.5.1, 4.5, 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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