Dundas Chart for ASP.NET
Coordinates Property
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl Namespace > MapArea Class : Coordinates Property


Gets or sets the coordinates of a MapArea object.


Coordinates of the area.

Syntax

Visual Basic (Declaration)  
Public Property Coordinates As Single()
Visual Basic (Usage) Copy Code
Dim instance As MapArea
Dim value() As Single
 
instance.Coordinates = value
 
value = instance.Coordinates
C#  
public float[] Coordinates {get; set;}

Return Value

An array of coordinates that is dependent on the shape of the map area.

Example

The following sample creates a custom image map that has a rectangular shape. We set the shape and coordinates of the MapArea object, and then add it to the MapAreas collection in the Page_Load event.

Visual Basic Copy Code
Imports Dundas.Charting.WebControl
...

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    'declare map area and coordinates variables, initializing coordinates
    Dim mapArea As New MapArea()
    Dim myCoordinates() As Single = {0, 0, 50, 50}

    'set the coordinates, shape, tooltip and href properties of the map area object
    mapArea.Coordinates = myCoordinates
    mapArea.Shape = MapAreaShape.Rectangle
    mapArea.Href = " http://www.SomeDomain.com"
    mapArea.ToolTip = "My Tooltip"

    'add the map area to the MapAreasCollection
    Chart1.MapAreas.Add(mapArea)

End Sub

Remarks

This property is usually used to set the coordinates of a custom map area object which has a user-defined shape and coordinates.

The coordinates that must be specified for a custom map area depend on the shape of the map area:

  • Circle. Three coordinates must be provided: "x1,y1,r", where "x1,y2" are the coordinates of the center of the circle, and "r" is the radius of the circle.

  • Rectangle. Four coordinates must be provided: "x1,y1,x2,y2", where "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 and y pairs must be provided "x1,y1,x2,y2...xn,yn", where each "x,y" pair contains the coordinates of one vertex of the polygon.

When setting coordinates use the chart's relative coordinate system, where the top-left corner of the chart image is "0,0" and the bottom-right corner of the image is "100,100". For more information see the Chart Coordinate System topic.

Once a map area's shape and coordinates are defined the ToolTip, Href and/or MapAreaAttributes properties can be used to specify some sort of user interaction.

Please note:

  • A client-side image map will only be created at run-time if the MapEnabled property of the root Chart object is true (the default).
  • To create an image map by adding a MapArea object to the map areas collection the RenderType property of the Chart object MUST be RenderType.ImageTag. It is possible to create an image map when using binary streaming, but a special technique must be used. Refer to the Client-Side Mapping and Binary Streaming  topic for further details.

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.