/// <summary> /// Create an annotation text and add it to the chart area. and return annotation. /// </summary> public TextAnnotation AddAnnotationText(string name, string text, PointF position, System.Drawing.Color?borderColor, Font font, Base.FontDrawFlags TextAlign, bool isStaticPositionX = true, bool isStaticPositionY = true, float opacity = 1, Charting.Base.AnnotationDrawingLayer drawingLayer = Charting.Base.AnnotationDrawingLayer.FrontOfSeriesAndAxisAndGrid, Axis Vertical_axis = null, Axis Horizontal_axis = null) { TextAnnotation annot = new TextAnnotation(this); annotations.Add(annot); annot.IsRelativePositionX = !isStaticPositionX; annot.IsRelativePositionY = !isStaticPositionY; annot.Position = position; annot.opacity = opacity; annot.color = borderColor; annot.DrawingLayer = drawingLayer; annot.Text = text; annot.Align = TextAlign; annot.Initialize(device); annot.TextFont = font; annot.Name = name; annot.horizontalAxis = Horizontal_axis; annot.verticalAxis = Vertical_axis; ReDrawLayer(drawingLayer); return(annot); }
/// <summary> /// Create an annotation shape and add it to the chart area. and return annotation. /// </summary> public Annotation AddAnnotationShape(string name, string text, PointF topLeftPoint, PointF bottomRight, bool isRectangleAnnotation, System.Drawing.Color?borderColor, Bitmap bitmap, float lineWidth = 2, float opacity = 1, Charting.Base.AnnotationDrawingLayer drawingLayer = Charting.Base.AnnotationDrawingLayer.FrontOfSeriesAndAxisAndGrid, Axis Vertical_axis = null, Axis Horizontal_axis = null) { AnnotationShape annot; if (isRectangleAnnotation) { annot = new AnnotationRectangle(this); } else { annot = new AnnotationEllipse(this); } annotations.Add(annot); annot.startValuePoint = topLeftPoint; annot.endValuePoint = bottomRight; annot.opacity = opacity; annot.Bitmap = bitmap; annot.color = borderColor; annot.lineWidth = lineWidth; annot.DrawingLayer = drawingLayer; annot.Initialize(device); annot.horizontalAxis = Horizontal_axis; annot.verticalAxis = Vertical_axis; ReDrawLayer(drawingLayer); annot.Name = name; Text = text; return(annot); }
/// <summary> /// Create an annotation line and add it to the chart area. and return annotation. /// </summary> public Annotation AddAnnotationLine(string name, string text, float value, bool isHorizontalAnnotationLine, System.Drawing.Color color, float lineWidth = 2, float opacity = 1, Charting.Base.AnnotationDrawingLayer drawingLayer = Charting.Base.AnnotationDrawingLayer.FrontOfSeriesAndAxisAndGrid, Axis Vertical_axis = null, Axis Horizontal_axis = null) { Annotation annot = AddAnnotationLine(name, text, value, isHorizontalAnnotationLine); annot.opacity = opacity; annot.lineWidth = lineWidth; annot.DrawingLayer = drawingLayer; if (annot.GetType().BaseType == typeof(AnnotationLine)) { ((AnnotationLine)annot).color = color; } annot.horizontalAxis = Horizontal_axis; annot.verticalAxis = Vertical_axis; ReDrawLayer(drawingLayer); return(annot); }
/// <summary> /// Create an annotation shape and add it to the chart area. and return annotation. /// </summary> public Annotation AddAnnotationShape(string name, string text, PointF[] points, System.Drawing.Color?borderColor, System.Drawing.Color?fillColor, float lineWidth = 2, float opacity = 1, Charting.Base.AnnotationDrawingLayer drawingLayer = Charting.Base.AnnotationDrawingLayer.FrontOfSeriesAndAxisAndGrid, Charting.Base.FillPattern fillPattern = Charting.Base.FillPattern.Solid, float patternSize = 8, Axis Vertical_axis = null, Axis Horizontal_axis = null) { AnnotationPolygon annot; annot = new AnnotationPolygon(this, points); annotations.Add(annot); annot.opacity = opacity; annot.lineWidth = lineWidth; annot.fillColor = fillColor; annot.color = borderColor; annot.DrawingLayer = drawingLayer; annot.fillPattern = fillPattern; annot.patternSize = patternSize; annot.Initialize(device); annot.horizontalAxis = Horizontal_axis; annot.verticalAxis = Vertical_axis; ReDrawLayer(drawingLayer); annot.Name = name; annot.Text = text; return(annot); }
/// <summary> /// Create an annotation line and add it to the chart area. and return annotation. /// </summary> Annotation AddAnnotationLine(string name, string text, float value, bool isHorizontalAnnotationLine, Charting.Base.AnnotationDrawingLayer drawingLayer = Charting.Base.AnnotationDrawingLayer.FrontOfSeriesAndAxisAndGrid) { AnnotationLine annot; if (isHorizontalAnnotationLine) { annot = new HorizontalAnnotationLine(this); } else { annot = new VerticalAnnotationLine(this); } annot.Name = name; annot.DrawingLayer = drawingLayer; annot.value = value; annot.Text = text; annotations.Add(annot); annot.Initialize(device); ReDrawLayer(drawingLayer); return(annot); }