Get Mouse click event from Microsoft Chart Control click on data marker

被刻印的时光 ゝ 提交于 2019-12-04 16:43:22
Quantbuff

You can try this:

protected void Page_Load(object sender, EventArgs e)
{
    foreach (DataPoint dp in this.Chart1.Series["YourSeriesName"].Points)
    {
        dp.PostBackValue = "#VALX,#VALY";
    }
}
protected void Chart1_Click(object sender, ImageMapEventArgs e)
{
    string[] pointData = e.PostBackValue.Split(',');
    // Add click event code here
}

You need to set OnClick="Chart1_Click" in asp:Chart. Or if you have multiple series on your chart you can set PostBack on Series directly and pass information about the series.

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