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


index

The index value where the item will be inserted (0-based).


Index to insert at.
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.
path

A GraphicsPath object that defines the shape of the map area.


Area coordinates as graphis path

Inserts a custom MapArea object into the MapAreasCollection, allowing for a tooltip, hyperlink, custom shape and map area attributes to be specified.


Insert new map area item into the collection.

Syntax

Visual Basic (Declaration)  
Public Overloads Sub Insert( _
   ByVal index As Integer, _
   ByVal toolTip As String, _
   ByVal href As String, _
   ByVal attr As String, _
   ByVal path As GraphicsPath _
) 
Visual Basic (Usage) Copy Code
Dim instance As MapAreasCollection
Dim index As Integer
Dim toolTip As String
Dim href As String
Dim attr As String
Dim path As GraphicsPath
 
instance.Insert(index, toolTip, href, attr, path)
C#  
public void Insert( 
   int index,
   string toolTip,
   string href,
   string attr,
   GraphicsPath path
)

Parameters

index

The index value where the item will be inserted (0-based).


Index to insert at.
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.
path

A GraphicsPath object that defines the shape of the map area.


Area coordinates as graphis path

Example

The following sample inserts a map area into the MapAreasCollection. It is the second MapArea object, and is a triangle. The GraphicsPath object allows us to specify map areas using a shape other than the pre-defined rectangles, circles and polygons.

Visual Basic Copy Code
'declare variables
Dim myGraphicsPath As New System.Drawing.Drawing2D.GraphicsPath()
Dim point1 As Drawing.PointF
Dim point2 As Drawing.PointF
Dim point3 As Drawing.PointF

'set the coordinates of PointF structures that will define the triangle
point1.X = 20
point1.Y = 20
point2.X = 50
point2.Y = 80
point3.X = 80
point3.Y = 20

'add lines to the GraphicsPath object for triangle
myGraphicsPath.AddLine(point1, point2)
myGraphicsPath.AddLine(point2, point3)
myGraphicsPath.AddLine(point3, point1)

'add map area, using the GraphicsPath object that defines the triangle
Chart1.MapAreas.Insert (1, "Tooltip1" & vbCrLf & "Tooltip2", "http://www.SomeDomain.com", "Target=_Blank", myGraphicsPath)

Remarks

Inserts a custom  MapArea object into the collection at the specified location, using the parameters to set the map area properties.

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.

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

Use this definition when the map area needs to be a shape other than a circle, rectangle or polygon.

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.