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

StackOverflow https://stackoverflow.com/questions/12743390

سؤال

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top