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


This event is used to customize map areas.
Fires just before the chart image map is rendered. Use this event to customize the map areas items.

Syntax

Visual Basic (Declaration)  
Public Event CustomizeMapAreas() As CustomizeMapAreasEventHandler
Visual Basic (Usage) Copy Code
Dim instance As Chart
Dim handler As CustomizeMapAreasEventHandler
 
AddHandler instance.CustomizeMapAreas, handler
C#  
public event CustomizeMapAreasEventHandler CustomizeMapAreas()

Event Data

The event handler receives an argument of type CustomizeMapAreasEventArgs containing data related to this event. The following CustomizeMapAreasEventArgs properties provide information specific to this event.

Property Description
MapAreaItems

Gets or sets a MapAreasCollection object. Can be used to: remove or modify map areas that correspond to a chart object; and add custom map areas.


MapArea items collection.

Example

The following sample loops through all map areas that have been created for a chart element, and removes those items that do not have a tooltip.
Visual Basic Copy Code
Imports Dundas.Charting.WebControl<CRLF>...<CRLF><CRLF>Private Sub Chart1_CustomizeMapAreas(ByVal chart As Chart, ByVal e As CustomizeMapAreasEventArgs) _<CRLF>Handles Chart1.CustomizeMapAreas<CRLF><CRLF> Dim areaIndex As Integer = 0<CRLF> While areaIndex < e.MapAreaItems.Count<CRLF> <CRLF> ' remove areas if there is no tooltip set<CRLF> If e.MapAreaItems(areaIndex).ToolTip = String.Empty Then<CRLF> e.MapAreaItems.RemoveAt(areaIndex)<CRLF> areaIndex -= 1<CRLF> End If<CRLF> areaIndex += 1<CRLF> <CRLF> End While<CRLF> <CRLF>End Sub

Remarks

The MapAreaItems property of the CustomizeMapAreasEventArgs parameter can be used to:

  • delete or modify map items that have automatically been created for a chart object (any data point, series, legend item or strip line object that has a non-empty Href, MapAreaAttributes or ToolTip property will have an associated map area object).
  • add custom map areas that have a user-defined shape and coordinates.

Note: the sender argument of type Chart is read-only.

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.