Dundas Chart for ASP.NET
Add(String,String,String,RectangleF) Method
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl Namespace > MapAreasCollection Class > Add Method : Add(String,String,String,RectangleF) Method


toolTip

The tooltip of the map area, which corresponds to the html <AREA> tag's Title attribute. Multi-line tooltips can be used using a carriage return/line feed (e.g. vbCrLf for VB).


Tool tip.
href

The destination URL or anchor point of the map area. Corresponds to the html <AREA> tag's HREF attribute.


Jump URL.
attr

One or more map area attributes. The entire string expression is appended at the end of the <AREA> tag.


Other area attributes.
rect

A RectangleF structure that defines the shape of the map area's rectangle.


Rect coordinates

Appends a custom MapArea object to the end of the MapAreasCollection, allowing for a tooltip, hyperlink, a RectangleF structure and map area attributes to be specified.


Add new map area item into the collection.

Syntax

Visual Basic (Declaration)  
Public Overloads Function Add( _
   ByVal toolTip As String, _
   ByVal href As String, _
   ByVal attr As String, _
   ByVal rect As RectangleF _
) As Integer
Visual Basic (Usage) Copy Code
Dim instance As MapAreasCollection
Dim toolTip As String
Dim href As String
Dim attr As String
Dim rect As RectangleF
Dim value As Integer
 
value = instance.Add(toolTip, href, attr, rect)
C#  
public int Add( 
   string toolTip,
   string href,
   string attr,
   RectangleF rect
)

Parameters

toolTip

The tooltip of the map area, which corresponds to the html <AREA> tag's Title attribute. Multi-line tooltips can be used using a carriage return/line feed (e.g. vbCrLf for VB).


Tool tip.
href

The destination URL or anchor point of the map area. Corresponds to the html <AREA> tag's HREF attribute.


Jump URL.
attr

One or more map area attributes. The entire string expression is appended at the end of the <AREA> tag.


Other area attributes.
rect

A RectangleF structure that defines the shape of the map area's rectangle.


Rect coordinates

Return Value

An integer that represents the index where the item was inserted into the collection (0-based).


Index of the newly added item.

Example

The following sample creates a map area in the shape of a rectangle. A RectangleF structure defines the shape of the map area.

Visual Basic Copy Code
Dim myRectF As New System.Drawing.RectangleF()

'set position of rectangleF structure
myRectF.X = 20
myRectF.Y = 20
myRectF.Width = 80
myRectF.Height = 80

'create the map area
Chart1.MapAreas.Add ("Tooltip1" & vbCrLf & "Tooltip2", "http://www.SomeDomain.com", "Target=_Blank", myRectF)

Remarks

Appends a MapArea object to the end of the collection, using the specified parameters to set the map area properties.

The attr parameter is used for map attributes such as "Target=_Blank", "OnClick="javascript:MyJavaScriptFunction()", etc.

Chart coordinates are used when setting the position of the rectangle. "0,0" represents the top-left corner of the chart image and "100,100" represents the bottom-right corner of the chart image. To find out more about the chart's coordinate system see the Chart Coordinate System topic.

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.

To create a map area that has a custom shape use the definition that takes a GraphicsPath object.

Requirements

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

See Also

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.