MapAreaAttributes Property
Collapse the table of content
Expand the table of content

MapArea.MapAreaAttributes Property

.NET Framework (current version)
 

Gets or sets the attributes of the map area.

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

[BindableAttribute(true)]
[PersistenceModeAttribute(PersistenceMode.Attribute)]
public string MapAreaAttributes { get; set; }

Property Value

Type: System.String

A string value that represents the attributes of the map area that corresponds to a particular chart element.

If you set this property, a client-side image map will be automatically created, and a map area will be created with the attribute string appended to the <MAP> tag that corresponds to the Chart object that this property is being set for. For example, setting the Target attribute using this property and setting the Url property of the first data point will result in HTML code that is similar to the following:

<img id="Chart1" USEMAP="#Chart1ImageMap" src="ChartPic_000002.jpg?6735e83b-f0cd-4225-8be4-047695a61040" border="0" />...<MAP NAME="Chart1ImageMap"><AREA SHAPE="rect" HREF="http://www.SomeDomain.ca" COORDS="69,120,106,309" Target=_Blank></MAP>

Because the entire string is appended to the <MAP> tag, multiple attributes should be separated with a space.

The MapAreaAttributes property can be used in conjunction with the Url property to specify map area attributes such as Target= _Blank, as well as client-side event handlers such as OnClick="MyEvent()".

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 in this manner, 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.

Special keywords can be used when you set this property. Each keyword will be replaced with some type of data from the applicable chart element. Refer to the following table for a list of all available keywords:

Keyword

Replaced by

#VALX

X-value of the data point.

#VAL, #VALY, #VALY2, #VALY3…

Y-values of the data point.

#SER

Series name.

#LABEL

Data point label.

#INDEX

Data point index.

#PERCENT

Percentage of the data point Y-value.

#TOTAL

Total of all Y-values in the series.

#LEGENDTEXT

Legend text.

To create image maps that have user-defined coordinates, use the MapAreas property of the root Chart object.

.NET Framework
Available since 4.0
Return to top
Show:
© 2016 Microsoft