我无法在饼图聊天中为饼图的各个部分(切片)触发事件。 [英] I'm unable to fire an event in the pie chat for the individual sections(slices) of the pie chart.
问题描述
我无法在饼图聊天中为饼图的各个部分(切片)触发事件。
我提到了图表事件代码...
覆盖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(对象发送者,ImageMapEventArgs e)
{
//代码
}
正如文档所说,你通过HotSpot.PostBackValue
告诉另一部分。 。片段实现为从System.Web.UI.WebControls.HotSpot
派生的类的不同热点,每个都有一些回发值,你可以在事件处理程序中看到,因为它在事件参数中通过ImageMapEventArgs.PostBackValue
传递给你。
请参阅:
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 [< a href =http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hotspot.aspxtarget =_ blanktitle =New Window> ^ ] ,
http:// msdn .microsoft.com / zh-cn / library / system.web.ui.webcontrols.hotspot.postbackvalue.aspx [ ^ ]。
< DD> -SA
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
}
As the documentation says, you tell one part from another by itsHotSpot.PostBackValue
. The fragments are implemented as different hot spots of the class derived fromSystem.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 throughImageMapEventArgs.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
这篇关于我无法在饼图聊天中为饼图的各个部分(切片)触发事件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!