在一系列的回传传球比#VALX和其他#VALY价值,得到图点击事件值 [英] pass other value than #VALX and #VALY in postback of series to get value on chart click event

查看:424
本文介绍了在一系列的回传传球比#VALX和其他#VALY价值,得到图点击事件值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用asp.net图表控件,我想用图表点击事件得到条形图栏中单击的 DEPTID 值。

 <&系列GT;
                        < ASP:系列名称=游图表类型=列ChartArea =MainChartAreaPostBackValue =#VALX>
                        < / ASP:系列>
                        < ASP:系列名称=检查图表类型=列ChartArea =MainChartAreaPostBackValue =#VALX>
                        < / ASP:系列>
                        < ASP:系列名称=NightHalt图表类型=列ChartArea =MainChartAreaPostBackValue =#VALX>
                        < / ASP:系列>
                    < /系列>

我是用部门名称显示在X轴,但我想捕捉 DEPTID 在图表上单击事件。在上面的标记,我使用 #VALX 串联回发事件,但它给我的单击事件DEPTNAME

 保护无效AllDepartmentComparisonBarChart_Click(对象发件人,ImageMapEventArgs E)
        {
            e.PostBackValue;        }


解决方案

也许你可以尝试删除你的意甲级PostBackValue,并尝试通过你的系列的数据点进行迭代,设置正确的DEPTID作为PostBackValue为每个数据点。

<一个href=\"http://msdn.microsoft.com/fr-fr/library/system.web.ui.datavisualization.charting.datapointcustomproperties.postbackvalue.aspx\" rel=\"nofollow\">http://msdn.microsoft.com/fr-fr/library/system.web.ui.datavisualization.charting.datapointcustomproperties.postbackvalue.aspx

I am using asp.net chart control and i want to use chart click event to get the deptId value of bar click in bar chart .

  <Series>                       
                        <asp:Series Name="Tour" ChartType="Column" ChartArea="MainChartArea"  PostBackValue="#VALX">
                        </asp:Series>
                        <asp:Series Name="Inspection" ChartType="Column" ChartArea="MainChartArea" PostBackValue="#VALX">
                        </asp:Series>
                        <asp:Series Name="NightHalt" ChartType="Column" ChartArea="MainChartArea" PostBackValue="#VALX">
                        </asp:Series>
                    </Series>

I am using department name to show on X axis but i want to capture deptid on chart click event . In above markup i use #VALX in series postback event but its give me deptname in click event

  protected void AllDepartmentComparisonBarChart_Click(object sender, ImageMapEventArgs e)
        {
            e.PostBackValue;

        }

解决方案

Maybe you can try removing your serie-level PostBackValue and try to iterate through the DataPoints of your Series, setting the correct deptId as PostBackValue for each individual DataPoint.

http://msdn.microsoft.com/fr-fr/library/system.web.ui.datavisualization.charting.datapointcustomproperties.postbackvalue.aspx

这篇关于在一系列的回传传球比#VALX和其他#VALY价值,得到图点击事件值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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