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


index

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


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


Index to insert at.
shape

A MapAreaShape enumeration value that determines the shape of the map area. Can be a circle, rectangle or polygon. The coord parameter determines its coordinates.


Area shape.
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).


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.


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


Other area attributes.
coord

Coordinates array that determines the location of the circle, rectangle or polygon. The type of shape that is being used determines the type of coordinates required. See below for further details.


Array of coordinates

Inserts a custom MapArea object into the MapAreasCollection, allowing for a tooltip, hyperlink, a pre-defined 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 shape As MapAreaShape, _
   ByVal toolTip As String, _
   ByVal href As String, _
   ByVal attr As String, _
   ByVal coord() As Single _
) 
Visual Basic (Usage) Copy Code
Dim instance As MapAreasCollection
Dim index As Integer
Dim shape As MapAreaShape
Dim toolTip As String
Dim href As String
Dim attr As String
Dim coord() As Single
 
instance.Insert(index, shape, toolTip, href, attr, coord)
C#  
public void Insert( 
   int index,
   MapAreaShape shape,
   string toolTip,
   string href,
   string attr,
   float[] coord
)

Parameters

index

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


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


Index to insert at.
shape

A MapAreaShape enumeration value that determines the shape of the map area. Can be a circle, rectangle or polygon. The coord parameter determines its coordinates.


Area shape.
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).


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.


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


Other area attributes.
coord

Coordinates array that determines the location of the circle, rectangle or polygon. The type of shape that is being used determines the type of coordinates required. See below for further details.


Array of coordinates

Example

The following sample inserts a map area into the MapAreasCollection. It is the second MapArea object in the collection, is a circle, and is drawn at the center of the chart image.

Visual Basic Copy Code
'declare and initialize array which defines circle coordinates within chart image
Dim myCoords() As Single = {50.0F, 50.0F, 10.0F}

'add map area to the chart, creating the image map
Chart1.MapAreas.Insert (1, MapAreaShape.Circle, "Tooltip1" & vbCrLf & "Tooltip2", "http://www.SomeDomain.com", "Target=_Blank", myCoords)

Remarks

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

The coord array parameter determines the coordinates of the map area shape, and is dependent on the shape being used:

  • Circle. Three coordinates must be provided: "x1,y1,r". "x1" and "y1" determine the center of the circle, and "r" is the radius of the circle.
  • Rectangle. Four coordinates must be provided: "x1,y1,x2,y2". "x1,y1" are the coordinates of the upper-left corner of the rectangle, and "x2,y2" are the coordinates of the lower-right corner of the rectangle.
  • Polygon. Two or more x,y pairs must be provided: "x1,y1,x2,y2...xn,yn". Each x,y pair determines the coordinates of one vertex of the polygon.

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.

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.