Gets or sets the map area attributes of a data point.
Other attributes of the area.
Visual Basic (Declaration) | |
---|---|
Public Property MapAreaAttributes As String |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public string MapAreaAttributes {get; set;} |
Return Value
A value that represents the attributes of the chart element's corresponding map area.
The following sample specifies a client-side javascript function to execute when the user clicks on the first data element.
Visual Basic | Copy Code |
---|---|
Chart1.Series("Series1").Points(0).MapAreaAttributes = "OnClick = javascript:MyFunction()" |
Setting this property will automatically result in a client-side image map being created, and a map area will be created with the attribute string appended to the <MAP> tag (that corresponds to the chart object this property is being set for). For example, setting the Target attribute using this property and the Href property of the first data point will result in html code 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>
Since the entire string is appended to the <MAP> tag multiple attributes should be separated with a space.
MapAreaAttributes can be used in conjunction with the Href property to specify map area attributes (e.g. Target= _Blank) as well as client-side event handlers (e.g. OnClick="MyEvent()").
Setting this property will have no effect if the Chart object's MapEnabled property is set to false (true by default).
IMPORTANT: To create an image map this way the RenderType property of the Chart object MUST be RenderType.ImageTag. It is possible to create an image map when using binary streaming, but another technique must be used. Refer to the Client-Side Mapping and Binary Streaming topic for further details.
If the MapAreaAttributes property is set for both a series and a data point of that series then the data point property has precedence.
Special keywords may be used when setting this property, and each keyword will be replaced with some type of data from the applicable chart element. Refer to the following table for a listing of all available keywords:
Keyword |
Replaced By |
#VALX |
X-value of the data point |
#VAL, #VALY, |
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.
Refer to the Client-Side Image Maps topic for more information on how to implement client-side mage maps.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family