private void button1_Click(object sender, EventArgs e) { ChartToolBarItem rotateItem = new ChartToolBarItem(); rotateItem.Name = "Rotation"; rotateItem.Image = Image.FromFile(@"..\..\Rotation.png"); this.chartControl1.ToolBar.Items.Add(rotateItem); this.chartControl1.ToolBar.ItemClick += new EventHandler(ToolBar_ItemClick); this.chartControl1.Size = new Size(475, 435); this.button1.Enabled = false; }
private void ToolBar_ItemClick(object sender, EventArgs e) { ChartToolBarItem tt = sender as ChartToolBarItem; if (tt.Name == "Rotation") { this.chartControl1.Series3D = true; if ((float)this.chartControl1.Rotation == 90) { this.chartControl1.Rotation = 30; } else { this.chartControl1.Rotation = this.chartControl1.Rotation + 5; } } }