Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I'm unable to fire an event in the pie chat for the individual sections(slices) of the pie chart.

I have mentioned the chart event code ...


override protected void OnInit(EventArgs e)
{
if (!Page.IsPostBack)
this.Chart1.Click += new ImageMapEventHandler(Chart1_Click);
base.OnInit(e);
InitializeComponent();
base.OnInit(e);
}

protected void Chart1_Click(object sender, ImageMapEventArgs e)
{
//Code
}
Posted

1 solution

As the documentation says, you tell one part from another by its HotSpot.PostBackValue. The fragments are implemented as different hot spots of the class derived from System.Web.UI.WebControls.HotSpot, each having some postback value which you can see in your event handler, as it is passed to you in the event arguments through ImageMapEventArgs.PostBackValue.

Please see:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.imagemapeventargs.aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.imagemapeventargs.postbackvalue.aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hotspot.aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hotspot.postbackvalue.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900