日期:2014-05-17 浏览次数:20446 次
//1.在Page_Load中添加Chart1的Click事件,索引每个点: protected void Page_Load(object sender, EventArgs e) { this.Chart1.Click += new ImageMapEventHandler(Chart1_Click); foreach (Series series in this.Chart1.Series) { series.PostBackValue = series.Name + ",#INDEX"; } } //2.在Chart1的Click事件下获得点击了第几个点!(加一个Label来显示演示) protected void Chart1_Click(object sender, ImageMapEventArgs e) { string[] input = e.PostBackValue.Split(','); Label1.Text = "你选中了" + input[0] + "的第 " + (Convert.ToInt16(input[1]) + 1).ToString() + " 点"; }