public int Add(FinancialMarkerType markerName, int firstPointIndex, int secondPointIndex, int firstYIndex, int secondYIndex, Color lineColor, int lineWidth, Color textColor, Font textFont)
        {
            FinancialMarker value  = new FinancialMarker(markerName, firstPointIndex, secondPointIndex, firstYIndex, secondYIndex, lineColor, lineWidth, textColor, textFont);
            int             result = this.array.Add(value);

            this.Invalidate();
            return(result);
        }
 public FinancialMarker(FinancialMarkerType markerType, int firstPointIndex, int secondPointIndex, int firstYIndex, int secondYIndex, Color lineColor, int lineWidth, Color textColor, Font textFont)
 {
     this.markerType       = markerType;
     this.firstPointIndex  = firstPointIndex;
     this.secondPointIndex = secondPointIndex;
     this.firstYIndex      = firstYIndex;
     this.secondYIndex     = secondYIndex;
     this.lineColor        = lineColor;
     this.lineWidth        = lineWidth;
     this.textColor        = textColor;
     this.textFont         = textFont;
 }
 public int Add(FinancialMarkerType markerName, int firstPointIndex, int secondPointIndex, int firstYIndex, int secondYIndex, Color lineColor, int lineWidth)
 {
     return(this.Add(markerName, firstPointIndex, secondPointIndex, firstYIndex, secondYIndex, lineColor, lineWidth, Color.Black, new Font(ChartPicture.GetDefaultFontFamilyName(), 8f)));
 }
 public void Insert(int index, FinancialMarkerType markerName, int firstPointIndex, int secondPointIndex)
 {
     this.Insert(index, markerName, firstPointIndex, secondPointIndex, 0, 0, Color.Gray, 1, Color.Black, new Font(ChartPicture.GetDefaultFontFamilyName(), 8f));
 }
 public void Insert(int index, FinancialMarkerType markerName, int firstPointIndex, int secondPointIndex, int firstYIndex, int secondYIndex, Color lineColor, int lineWidth)
 {
     this.Insert(index, markerName, firstPointIndex, secondPointIndex, firstYIndex, secondYIndex, lineColor, lineWidth, Color.Black, new Font(ChartPicture.GetDefaultFontFamilyName(), 8f));
 }
        public void Insert(int index, FinancialMarkerType markerName, int firstPointIndex, int secondPointIndex, int firstYIndex, int secondYIndex, Color lineColor, int lineWidth, Color textColor, Font textFont)
        {
            FinancialMarker value = new FinancialMarker(markerName, firstPointIndex, secondPointIndex, firstYIndex, secondYIndex, lineColor, lineWidth, textColor, textFont);

            this.array.Insert(index, value);
        }
 public int Add(FinancialMarkerType markerName, int firstPointIndex, int secondPointIndex)
 {
     return(this.Add(markerName, firstPointIndex, secondPointIndex, 0, 0, Color.Gray, 1, Color.Black, new Font(ChartPicture.GetDefaultFontFamilyName(), 8f)));
 }
        internal void DrawMarkers(ChartGraphics graph, ChartPicture chart, FinancialMarkerType markerName, Series series, int firstPoint, int firstYValue, int secondPoint, int secondYValue, Color lineColor, int lineWidth, ChartDashStyle lineStyle, Color textColor, Font textFont)
        {
            this.lineStyle = lineStyle;
            if (textColor == Color.Empty)
            {
                drawText = false;
            }
            else
            {
                this.textColor = textColor;
                drawText       = true;
            }
            if (lineColor == Color.Empty)
            {
                this.lineColor = Color.Gray;
            }
            else
            {
                this.lineColor = lineColor;
            }
            if (lineWidth == 0)
            {
                this.lineWidth = 1;
            }
            else
            {
                this.lineWidth = lineWidth;
            }
            if (textFont == null)
            {
                this.textFont = new Font(ChartPicture.GetDefaultFontFamilyName(), 8f);
            }
            else
            {
                this.textFont = textFont;
            }
            ChartArea chartArea = chart.ChartAreas[series.ChartArea];

            if (chartArea.Area3DStyle.Enable3D || chartArea.chartAreaIsCurcular || !chartArea.requireAxes)
            {
                return;
            }
            Axis   axis  = chartArea.GetAxis(AxisName.X, series.XAxisType, series.XSubAxisName);
            Axis   axis2 = chartArea.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
            double position;
            double position2;
            double position3;
            double position4;

            try
            {
                if (chartArea.Common.ChartTypeRegistry.GetChartType(series.ChartTypeName).SwitchValueAxes)
                {
                    axesSwitched = true;
                    Axis axis3 = axis2;
                    axis2     = axis;
                    axis      = axis3;
                    position  = axis.GetPosition(series.Points[firstPoint].YValues[firstYValue]);
                    position2 = axis2.GetPosition(series.Points[firstPoint].XValue);
                    position3 = axis.GetPosition(series.Points[secondPoint].YValues[secondYValue]);
                    position4 = axis2.GetPosition(series.Points[secondPoint].XValue);
                }
                else
                {
                    axesSwitched = false;
                    position     = axis.GetPosition(series.Points[firstPoint].XValue);
                    position2    = axis2.GetPosition(series.Points[firstPoint].YValues[firstYValue]);
                    position3    = axis.GetPosition(series.Points[secondPoint].XValue);
                    position4    = axis2.GetPosition(series.Points[secondPoint].YValues[secondYValue]);
                }
            }
            catch (Exception)
            {
                throw new InvalidOperationException(SR.ExceptionFinancialMarkersSeriesPointYValueIndexInvalid);
            }
            PointF relative  = new PointF((float)position, (float)position2);
            PointF relative2 = new PointF((float)position3, (float)position4);

            relative  = graph.GetAbsolutePoint(relative);
            relative2 = graph.GetAbsolutePoint(relative2);
            bool flag = false;

            foreach (DataPoint point in series.Points)
            {
                flag = true;
                if (point.XValue != 0.0)
                {
                    flag = false;
                    break;
                }
            }
            if (flag)
            {
                throw new InvalidOperationException(SR.ExceptionFormulaDataZeroIndexedXValuesUnsupported);
            }
            graph.SetClip(chartArea.PlotAreaPosition.ToRectangleF());
            SmoothingMode smoothingMode = graph.SmoothingMode;

            if ((graph.AntiAliasing & AntiAliasingTypes.Graphics) == AntiAliasingTypes.Graphics)
            {
                graph.SmoothingMode = SmoothingMode.AntiAlias;
            }
            switch (markerName)
            {
            case FinancialMarkerType.FibonacciArcs:
                FibonacciArcs(graph, relative, relative2);
                break;

            case FinancialMarkerType.TrendLine:
                TrendLine(graph, relative, relative2);
                break;

            case FinancialMarkerType.FibonacciFans:
                FibonacciFans(graph, relative, relative2, chartArea);
                break;

            case FinancialMarkerType.FibonacciRetracements:
                FibonacciRetracements(graph, relative, relative2, chartArea);
                break;

            case FinancialMarkerType.SpeedResistanceLines:
                SpeedResistanceLines(graph, relative, relative2, chartArea);
                break;

            case FinancialMarkerType.QuadrantLines:
                QuadrantLines(graph, relative, relative2, chartArea);
                break;

            default:
                throw new InvalidOperationException(SR.ExceptionFinancialMarkersFormulaNotFound);
            }
            graph.ResetClip();
            graph.SmoothingMode = smoothingMode;
        }