private void SetAnnotationStyle2() { if (AnnotationStyle2 == null || AnnotationStyle2.SelectedIndex == -1) { return; } if (Annotation.SelectedItem.Value == "Line") { LineAnnotation annotation = (LineAnnotation)Chart1.Annotations[0]; annotation.EndCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle2.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Vertical Line") { VerticalLineAnnotation annotation = (VerticalLineAnnotation)Chart1.Annotations[0]; annotation.EndCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle2.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Horizontal Line") { HorizontalLineAnnotation annotation = (HorizontalLineAnnotation)Chart1.Annotations[0]; annotation.EndCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle2.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Polyline") { PolylineAnnotation annotation = (PolylineAnnotation)Chart1.Annotations[0]; annotation.EndCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle2.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Rectangle") { RectangleAnnotation annotation = (RectangleAnnotation)Chart1.Annotations[0]; annotation.LineDashStyle = (ChartDashStyle)ChartDashStyle.Parse(typeof(ChartDashStyle), AnnotationStyle2.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Ellipse") { EllipseAnnotation annotation = (EllipseAnnotation)Chart1.Annotations[0]; annotation.LineDashStyle = (ChartDashStyle)ChartDashStyle.Parse(typeof(ChartDashStyle), AnnotationStyle2.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Polygon") { PolygonAnnotation annotation = (PolygonAnnotation)Chart1.Annotations[0]; annotation.LineDashStyle = (ChartDashStyle)ChartDashStyle.Parse(typeof(ChartDashStyle), AnnotationStyle2.SelectedItem.Value); } }
private void AnnotationStyle2_SelectedIndexChanged(object sender, System.EventArgs e) { if (Annotation.SelectedItem.ToString() == "Line") { LineAnnotation annotation = (LineAnnotation)Chart1.Annotations[0]; annotation.EndCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle2.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Vertical Line") { VerticalLineAnnotation annotation = (VerticalLineAnnotation)Chart1.Annotations[0]; annotation.EndCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle2.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Horizontal Line") { HorizontalLineAnnotation annotation = (HorizontalLineAnnotation)Chart1.Annotations[0]; annotation.EndCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle2.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Polyline") { PolylineAnnotation annotation = (PolylineAnnotation)Chart1.Annotations[0]; annotation.EndCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle2.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Rectangle") { RectangleAnnotation annotation = (RectangleAnnotation)Chart1.Annotations[0]; annotation.LineDashStyle = (ChartDashStyle)ChartDashStyle.Parse(typeof(ChartDashStyle), AnnotationStyle2.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Ellipse") { EllipseAnnotation annotation = (EllipseAnnotation)Chart1.Annotations[0]; annotation.LineDashStyle = (ChartDashStyle)ChartDashStyle.Parse(typeof(ChartDashStyle), AnnotationStyle2.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Polygon") { PolygonAnnotation annotation = (PolygonAnnotation)Chart1.Annotations[0]; annotation.LineDashStyle = (ChartDashStyle)ChartDashStyle.Parse(typeof(ChartDashStyle), AnnotationStyle2.SelectedItem.ToString()); } }
private void AnnotationStyle1_SelectedIndexChanged(object sender, System.EventArgs e) { if (Annotation.SelectedItem.ToString() == "Line") { LineAnnotation annotation = (LineAnnotation)Chart1.Annotations[0]; annotation.StartCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle1.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Vertical Line") { VerticalLineAnnotation annotation = (VerticalLineAnnotation)Chart1.Annotations[0]; annotation.StartCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle1.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Horizontal Line") { HorizontalLineAnnotation annotation = (HorizontalLineAnnotation)Chart1.Annotations[0]; annotation.StartCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle1.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Polyline") { PolylineAnnotation annotation = (PolylineAnnotation)Chart1.Annotations[0]; annotation.StartCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle1.SelectedItem.ToString()); } else if (Annotation.SelectedItem.ToString() == "Rectangle") { RectangleAnnotation annotation = (RectangleAnnotation)Chart1.Annotations[0]; annotation.BackColor = Color.FromArgb(128, Color.FromName(AnnotationStyle1.SelectedItem.ToString())); } else if (Annotation.SelectedItem.ToString() == "Ellipse") { EllipseAnnotation annotation = (EllipseAnnotation)Chart1.Annotations[0]; annotation.BackColor = Color.FromArgb(128, Color.FromName(AnnotationStyle1.SelectedItem.ToString())); } else if (Annotation.SelectedItem.ToString() == "Arrow") { ArrowAnnotation annotation = (ArrowAnnotation)Chart1.Annotations[0]; if (AnnotationStyle1.SelectedItem.ToString() != "") { annotation.ArrowSize = int.Parse(AnnotationStyle1.SelectedItem.ToString()); } } else if (Annotation.SelectedItem.ToString() == "Border3D") { Border3DAnnotation annotation = (Border3DAnnotation)Chart1.Annotations[0]; annotation.BorderSkin.BackColor = Color.FromArgb(128, Color.FromName(AnnotationStyle1.SelectedItem.ToString())); } else if (Annotation.SelectedItem.ToString() == "Callout") { CalloutAnnotation annotation = (CalloutAnnotation)Chart1.Annotations[0]; annotation.BackColor = Color.FromArgb(128, Color.FromName(AnnotationStyle1.SelectedItem.ToString())); } else if (Annotation.SelectedItem.ToString() == "Polygon") { PolygonAnnotation annotation = (PolygonAnnotation)Chart1.Annotations[0]; annotation.LineColor = Color.FromName(AnnotationStyle1.SelectedItem.ToString()); } }
private void SetAnnotationStyle1() { if (AnnotationStyle1 == null || AnnotationStyle1.SelectedIndex == -1) { return; } if (Annotation.SelectedItem.Value == "Line") { LineAnnotation annotation = (LineAnnotation)Chart1.Annotations[0]; annotation.StartCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle1.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Vertical Line") { VerticalLineAnnotation annotation = (VerticalLineAnnotation)Chart1.Annotations[0]; annotation.StartCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle1.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Horizontal Line") { HorizontalLineAnnotation annotation = (HorizontalLineAnnotation)Chart1.Annotations[0]; annotation.StartCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle1.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Polyline") { PolylineAnnotation annotation = (PolylineAnnotation)Chart1.Annotations[0]; annotation.StartCap = (LineAnchorCapStyle)LineAnchorCapStyle.Parse(typeof(LineAnchorCapStyle), AnnotationStyle1.SelectedItem.Value); } else if (Annotation.SelectedItem.Value == "Rectangle") { RectangleAnnotation annotation = (RectangleAnnotation)Chart1.Annotations[0]; annotation.BackColor = Color.FromArgb(128, Color.FromName(AnnotationStyle1.SelectedItem.Value)); } else if (Annotation.SelectedItem.Value == "Ellipse") { EllipseAnnotation annotation = (EllipseAnnotation)Chart1.Annotations[0]; annotation.BackColor = Color.FromArgb(128, Color.FromName(AnnotationStyle1.SelectedItem.Value)); } else if (Annotation.SelectedItem.Value == "Arrow") { ArrowAnnotation annotation = (ArrowAnnotation)Chart1.Annotations[0]; if (AnnotationStyle1.SelectedItem.Value != "") { annotation.ArrowSize = int.Parse(AnnotationStyle1.SelectedItem.Value); } } else if (Annotation.SelectedItem.Value == "Border3D") { Border3DAnnotation annotation = (Border3DAnnotation)Chart1.Annotations[0]; annotation.BorderSkin.BackColor = Color.FromArgb(128, Color.FromName(AnnotationStyle1.SelectedItem.Value)); } else if (Annotation.SelectedItem.Value == "Callout") { CalloutAnnotation annotation = (CalloutAnnotation)Chart1.Annotations[0]; annotation.BackColor = Color.FromArgb(128, Color.FromName(AnnotationStyle1.SelectedItem.Value)); } else if (Annotation.SelectedItem.Value == "Polygon") { PolygonAnnotation annotation = (PolygonAnnotation)Chart1.Annotations[0]; annotation.LineColor = Color.FromName(AnnotationStyle1.SelectedItem.Value); } }