Spread for ASP.NET 7.0 Product Documentation
MapAreaClick Event
See Also  Example Support Options
FarPoint.Web.Chart Assembly > FarPoint.Web.Chart Namespace > FpChart Class : MapAreaClick Event


Glossary Item Box

Occurs when a map area is clicked.

Syntax

Visual Basic (Declaration) 
Public Event MapAreaClick As MapAreaClickEventHandler
Visual Basic (Usage)Copy Code
Dim instance As FpChart
Dim handler As MapAreaClickEventHandler
 
AddHandler instance.MapAreaClick, handler
C# 
public event MapAreaClickEventHandler MapAreaClick

Event Data

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

PropertyDescription
MapAreaInfo Gets or sets the MapAreaInfo indicates the event source.

Remarks

Each map area on the client side corresponds to a chart element (plot area, legend, series, etc...). The RenderMapArea property should be set to true to use this event.

The EnableClickEvent property specifies whether the Click event fires.

The MapAreaClick event fires if the RenderMapArea property is true and the EnableClickEvent property is false. If the RenderMapArea property is false and the EnableClickEvent property is true, only the Click event fires. If the RenderMapArea property is true and the EnableClickEvent property is true, the MapAreaClick event fires if the user clicks on a chart element. The Click event fires if the user clicks on the chart background.

The HotSpotMode property is used if RenderMapArea is true. HotSpotMode determines the behavior when the user clicks in a map area. The options are inactive, navigate, and post back. The inactive option is useful if you wish to display a tooltip in the map area. If the HotSpotMode is set to post back, the MapAreaClick and Client events are fired. If the RenderMapArea property is false, the HotSpotMode property has no effect.

Example

This example uses the MapAreaClick event.
C#Copy Code
FpChart1.RenderMapArea = true;
FpChart1.HotSpotMode = HotSpotMode.PostBack;

protected void FpChart1_MapAreaClick(object sender, MapAreaClickEventArgs e)
{
HitTest hitTest = this.FpChart1.HitTest(e.MapAreaInfo);
this.Label1.Text = hitTest.ToString();
}
Visual BasicCopy Code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Me.IsPostBack) Then Return
        FpChart1.RenderMapArea = True
        FpChart1.HotSpotMode = HotSpotMode.PostBack
End Sub

Protected Sub FpChart1_MapAreaClick(ByVal sender As Object, ByVal e As FarPoint.Web.Chart.MapAreaClickEventArgs) Handles FpChart1.MapAreaClick
        Dim hit As FarPoint.Web.Chart.HitTest
        hit = FpChart1.HitTest(e.MapAreaInfo)
        ListBox1.Items.Add(hit.ToString())
End Sub

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.