我无法在饼图聊天中为饼图的各个部分(切片)触发事件。 [英] I'm unable to fire an event in the pie chat for the individual sections(slices) of the pie chart.

查看:71
本文介绍了我无法在饼图聊天中为饼图的各个部分(切片)触发事件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我无法在饼图聊天中为饼图的各个部分(切片)触发事件。



我提到了图表事件代码...





覆盖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 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


这篇关于我无法在饼图聊天中为饼图的各个部分(切片)触发事件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆