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


Gets or sets the shape of a MapArea object.


Shape of the area.

Syntax

Visual Basic (Declaration)  
Public Property Shape As MapAreaShape
Visual Basic (Usage) Copy Code
Dim instance As MapArea
Dim value As MapAreaShape
 
instance.Shape = value
 
value = instance.Shape
C#  
public MapAreaShape Shape {get; set;}

Return Value

A MapAreaShape enumeration value that determines the shape of a map area object.

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 shape of a custom map area object, which has a user-defined shape and coordinates.

The shape of the custom map area determines the type of coordinates that must be specified, and available shapes are circles, rectangles and polygons.

When retrieving the shapes of MapArea object's that are stored in the MapAreasCollection any shape that is not a rectangle or a circle will be considered a polygon. For example, a custom map area can be added to the map areas collection using a GraphicsPath object as a parameter, which allows for any type of shape to be used. If the Shape property of this particular MapArea object is retrieved it will return MapAreaShape.Polygon.

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.