pass other value than #VALX and #VALY in postback of series to get value on chart click event

好久不见. 提交于 2019-12-11 14:12:01

问题


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;

        }

回答1:


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



来源:https://stackoverflow.com/questions/12743390/pass-other-value-than-valx-and-valy-in-postback-of-series-to-get-value-on-char

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!