protected void Chart1_Click(object sender, ImageMapEventArgs e) { // If user clicks on the map area attribute that corresponds to a legend item if (e.PostBackValue.StartsWith("LegendClick")) { string args = e.PostBackValue.Split('/')[1]; // Identify which legend item was clicked int index = int.Parse(args); // Legend item result LegendItem legendItem = this.Chart1.Legends[0].CustomItems[index]; // Resets all radio button images to be unchecked /* foreach (LegendItem item in this.Chart1.Legends[0].CustomItems) { item.Cells[0].ImageTransparentColor = Color.Black; item.Cells[0].Image = "radio_button_unchecked.gif"; } */ for (; ; ) { switch (legendItem.Cells[1].Text) { case "Points": this.Chart1.Series["series1"].Enabled = true; this.Chart1.Series["series2"].Enabled = false; this.Chart1.Series["series3"].Enabled = false; this.Chart1.Series[0].ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), "Line", true); this.Chart1.Legends[0].CustomItems[0].Cells[0].Image = "radio_button_checked.gif"; break; case "CSAT": this.Chart1.Series["series1"].Enabled = false; this.Chart1.Series["series2"].Enabled = true; this.Chart1.Series["series3"].Enabled = false; this.Chart1.Legends[0].CustomItems[1].Cells[0].Image = "radio_button_checked.gif"; break; case "SLA": this.Chart1.Series["series1"].Enabled = false; this.Chart1.Series["series2"].Enabled = false; ; this.Chart1.Series["series3"].Enabled = true; this.Chart1.Legends[0].CustomItems[2].Cells[0].Image = "radio_button_checked.gif"; break; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)