Esempio n. 1
0
        public virtual pwiz.MSGraph.PointAnnotation AnnotatePoint(ZedGraph.PointPair point)
        {
            if (annotationSettings != null)
            {
                Map <double, SeemsPointAnnotation> .Enumerator itr = annotationSettings.PointAnnotations.Find(point.X);
                if (itr.IsValid && itr.Current.Value != null)
                {
                    return(new pwiz.MSGraph.PointAnnotation(itr.Current.Value.Label));
                }

                return(annotationSettings.AnnotatePoint(point));
            }

            return(null);
        }
Esempio n. 2
0
        public pwiz.MSGraph.PointAnnotation AnnotatePoint(ZedGraph.PointPair point)
        {
            string label = null;

            if (ShowXValues && ShowYValues)
            {
                label = String.Format("{0:f2}\n{1:f2}", point.X, point.Y);
            }
            else if (ShowXValues)
            {
                label = String.Format("{0:f2}", point.X);
            }
            else if (ShowYValues)
            {
                label = String.Format("{0:f2}", point.Y);
            }

            if (label != null)
            {
                return(new pwiz.MSGraph.PointAnnotation(label, pointFontSpec));
            }
            return(null);
        }
Esempio n. 3
0
        public pwiz.MSGraph.PointAnnotation AnnotatePoint(ZedGraph.PointPair point)
        {
            string label = null;

            if (ShowXValues && ShowYValues)
            {
                label = String.Format("{0]\n{1}", point.X.ToString("f" + Properties.Settings.Default.DefaultDecimalPlaces), point.Y.ToString("f" + Properties.Settings.Default.DefaultDecimalPlaces));
            }
            else if (ShowXValues)
            {
                label = String.Format("{0}", point.X.ToString("f" + Properties.Settings.Default.DefaultDecimalPlaces));
            }
            else if (ShowYValues)
            {
                label = String.Format("{0}", point.Y.ToString("f" + Properties.Settings.Default.DefaultDecimalPlaces));
            }

            if (label != null)
            {
                return(new pwiz.MSGraph.PointAnnotation(label, pointFontSpec));
            }
            return(null);
        }
Esempio n. 4
0
        public void SetScale(int bins, double min, double max)
        {
            if (scaledWidth == bins && scaledMin == min && scaledMax == max)
            {
                return;
            }

            scaledWidth = bins;
            scaledMin   = min;
            scaledMax   = max;
            scaleRange  = max - min;
            scaleFactor = bins / scaleRange;
            scaledPointList.Clear();
            scaledPointList.Capacity = bins * 4;            // store 4 points for each bin (entry, min, max, exit)
            scaledMaxIndexList.Clear();
            scaledMaxIndexList.Capacity = bins;             // store just the index of the max point for each bin
            int lastBin          = -1;
            int curBinEntryIndex = -1;
            int curBinMinIndex   = -1;
            int curBinMaxIndex   = -1;
            int curBinExitIndex  = -1;

            for (int i = 0; i < fullPointList.Count; ++i)
            {
                ZedGraph.PointPair point = fullPointList[i];

                if (point.X < min)
                {
                    continue;
                }

                if (point.X > max)
                {
                    break;
                }

                int curBin = (int)Math.Round(scaleFactor * (point.X - min));
                if (curBin > lastBin)                  // new bin, insert points of last bin
                {
                    if (lastBin > -1)
                    {
                        scaledMinIndex = curBinMinIndex;
                        scaledPointList.Add(fullPointList[curBinEntryIndex]);
                        if (curBinEntryIndex != curBinMinIndex)
                        {
                            scaledPointList.Add(fullPointList[curBinMinIndex]);
                        }
                        if (curBinEntryIndex != curBinMaxIndex &&
                            curBinMinIndex != curBinMaxIndex)
                        {
                            scaledPointList.Add(fullPointList[curBinMaxIndex]);
                        }
                        if (curBinEntryIndex != curBinMaxIndex &&
                            curBinMinIndex != curBinMaxIndex &&
                            curBinMaxIndex != curBinExitIndex)
                        {
                            scaledPointList.Add(fullPointList[curBinExitIndex]);
                        }
                        if (fullPointList[curBinMaxIndex].Y != 0)
                        {
                            scaledMaxIndexList.Add(curBinMaxIndex);
                        }
                    }
                    lastBin          = curBin;
                    curBinEntryIndex = i;
                    curBinMinIndex   = i;
                    curBinMaxIndex   = i;
                }
                else                   // same bin, set exit point
                {
                    curBinExitIndex = i;
                    if (point.Y > fullPointList[curBinMaxIndex].Y)
                    {
                        scaledMaxIndex = curBinMaxIndex = i;
                    }
                    else if (point.Y < fullPointList[curBinMaxIndex].Y)
                    {
                        curBinMinIndex = i;
                    }
                }
            }

            if (lastBin > -1)
            {
                scaledMinIndex = curBinMinIndex;
                scaledPointList.Add(fullPointList[curBinEntryIndex]);
                if (curBinEntryIndex != curBinMinIndex)
                {
                    scaledPointList.Add(fullPointList[curBinMinIndex]);
                }
                if (curBinEntryIndex != curBinMaxIndex &&
                    curBinMinIndex != curBinMaxIndex)
                {
                    scaledPointList.Add(fullPointList[curBinMaxIndex]);
                }
                if (curBinEntryIndex != curBinMaxIndex &&
                    curBinMinIndex != curBinMaxIndex &&
                    curBinMaxIndex != curBinExitIndex)
                {
                    scaledPointList.Add(fullPointList[curBinExitIndex]);
                }
                if (fullPointList[curBinMaxIndex].Y != 0)
                {
                    scaledMaxIndexList.Add(curBinMaxIndex);
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Main loop for testing extrema algorithm.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void timer1_Tick_1(object sender, EventArgs e)
        {
            zedGraph.GraphPane.CurveList.Clear();

            // Create maxima/minima finder
            SignalProcessing.LocalExtremaDetection maxMinDetect = new SignalProcessing.LocalExtremaDetection();

            // Set search window size based on UI
            try
            {
                maxMinDetect.SetSearchWindowRadius(Convert.ToInt32(textBoxSearchWindowRadius.Text));
            }
            catch
            {
                maxMinDetect.SetSearchWindowRadius(0);
            }

            // Enable thresholding
            if (checkBoxEnableThresholding.Checked == true)
            {
                maxMinDetect.EnableThresholding(true);
            }
            else
            {
                maxMinDetect.EnableThresholding(false);
            }

            // Set threshold dataIList based on UI
            try
            {
                maxMinDetect.SetThreshold(Convert.ToDouble(textBoxThresholdValue.Text));
            }
            catch
            {
                maxMinDetect.SetThreshold(0.0);
            }

            if (checkBoxEnableAlternateExtremaRule.Checked)
            {
                maxMinDetect.EnforceAlternateExtrema(true);
            }
            else
            {
                maxMinDetect.EnforceAlternateExtrema(false);
            }

            int maxMinCounter    = 0;
            int maxMinResetIndex = 0;

            // Loop through each data point for a particular capacitance channel, adding series
            ZedGraph.PointPairList pointPairList = new ZedGraph.PointPairList();



            int filterLength;

            try
            {
                filterLength = Convert.ToInt32(textBoxFirFilterLength.Text);
            }
            catch
            {
                filterLength = 1;
            }

            // Filter
            List <double> filteredDataList = SignalProcessing.Averaging.MovingAverage(dataList.ToArray(), filterLength).ToList <double>();

            // Get most recent numberOfPointsToPlot amount of data from the table
            for (int x = 0; x < dataList.Count; x++)
            {
                ZedGraph.PointPair pointPair = new ZedGraph.PointPair();
                pointPair.X = (double)x;
                // Get capacitance
                pointPair.Y = filteredDataList[x];
                //pointPair.Y = dataTable.Rows[x].Field<int>(dataNames[y-1]);
                pointPairList.Add(pointPair);
            }

            // Add line to graph with legend name
            ZedGraph.LineItem lineItem = zedGraph.GraphPane.AddCurve("Test data", pointPairList, Color.Blue);

            // Find local extrema
            labelNumExtrema.Text = Convert.ToString(maxMinDetect.FindLocalExtrema(filteredDataList));

            // Retrieve indecies of extrema
            List <int> maxima = maxMinDetect.GetMaxima();
            List <int> minima = maxMinDetect.GetMinima();

            // Add  maxima markers
            for (int i = 0; i < maxima.Count(); i++)
            {
                ZedGraph.LineItem line = new ZedGraph.LineItem("Point", new double[] { maxima[i] }, new double[] { filteredDataList[maxima[i]] }, Color.Black, ZedGraph.SymbolType.TriangleDown);
                line.Symbol.Size = 20;
                // Colour the same as the line
                line.Symbol.Fill = new ZedGraph.Fill(Color.Green);
                // Don't draw label on legend
                line.Label.IsVisible = false;
                // Add marker to graph
                zedGraph.GraphPane.CurveList.Add(line);
            }
            // Add minima markers
            for (int i = 0; i < minima.Count(); i++)
            {
                ZedGraph.LineItem line = new ZedGraph.LineItem("Point", new double[] { minima[i] }, new double[] { filteredDataList[minima[i]] }, Color.Black, ZedGraph.SymbolType.Triangle);
                line.Symbol.Size = 20;
                // Colour the same as the line
                line.Symbol.Fill = new ZedGraph.Fill(Color.Green);
                // Don't draw label on legend
                line.Label.IsVisible = false;
                // Add marker to graph
                zedGraph.GraphPane.CurveList.Add(line);
            }

            zedGraph.AxisChange();

            this.SetBasicGraphColours(zedGraph, Color.Black, Color.White);

            // Re-draw graph
            zedGraph.Invalidate();
        }
Esempio n. 6
0
        public void SetDataLabelsVisible(bool visible)
        {
            //zedGraphControl1.GraphPane.GraphObjList.Clear();
            foreach (ZedGraph.GraphObj dataLabel in dataLabels)
            {
                zedGraphControl1.GraphPane.GraphObjList.Remove(dataLabel);
            }

            if (visible)
            {
                if (!(AnnotationSettings.ShowChromatogramPointTimes || AnnotationSettings.ShowScanPointMZs ||
                      AnnotationSettings.ShowChromatogramPointIntensities || AnnotationSettings.ShowScanPointIntensities ||
                      AnnotationSettings.ShowUnmatchedAnnotations || AnnotationSettings.ShowMatchedAnnotations))
                {
                    return;
                }

                // set direct references
                ZedGraph.GraphPane pane  = zedGraphControl1.GraphPane;
                ZedGraph.Axis      xAxis = pane.XAxis;
                ZedGraph.Axis      yAxis = pane.YAxis;
                yAxis.Scale.MinAuto = false;
                yAxis.Scale.Min     = 0;

                // setup axes scales to enable the Transform method
                xAxis.Scale.SetupScaleData(pane, xAxis);
                yAxis.Scale.SetupScaleData(pane, yAxis);

                Graphics g = zedGraphControl1.CreateGraphics();
                //pane.Draw( g );
                pane.CurveList.Draw(g, pane, 1.0f);
                System.Drawing.Bitmap gmap = new Bitmap(Convert.ToInt32(pane.Rect.Width), Convert.ToInt32(pane.Rect.Height));
                zedGraphControl1.DrawToBitmap(gmap, Rectangle.Round(pane.Rect));
                Region chartRegion = new Region(pane.Chart.Rect);
                Region clipRegion  = new Region();
                clipRegion.MakeEmpty();
                g.SetClip(zedGraphControl1.MasterPane.Rect, CombineMode.Replace);
                g.SetClip(chartRegion, CombineMode.Exclude);

                /*Bitmap clipBmp = new Bitmap( Convert.ToInt32( pane.Rect.Width ), Convert.ToInt32( pane.Rect.Height ) );
                 * Graphics clipG = Graphics.FromImage( clipBmp );
                 * clipG.Clear( Color.White );
                 * clipG.FillRegion( new SolidBrush( Color.Black ), g.Clip );
                 * clipBmp.Save( "C:\\clip.bmp" );*/

                PointDataMap <SeemsPointAnnotation> matchedAnnotations = new PointDataMap <SeemsPointAnnotation>();

                // add automatic labels
                foreach (ZedGraph.CurveItem curve in pane.CurveList)
                {
                    SeemsPointList pointList = (SeemsPointList)curve.Points;
                    for (int i = 0; i < pointList.MaxCount; i++)
                    {
                        ZedGraph.PointPair pt = pointList.GetPointAtIndex(pointList.ScaledMaxIndexList[i]);
                        if (pt.X < xAxis.Scale.Min || pt.Y > yAxis.Scale.Max || pt.Y < yAxis.Scale.Min)
                        {
                            continue;
                        }
                        if (pt.X > xAxis.Scale.Max)
                        {
                            break;
                        }

                        StringBuilder pointLabel = new StringBuilder();
                        Color         pointColor = curve.Color;

                        // Add annotation
                        double annotationX = 0.0;
                        SeemsPointAnnotation annotation = null;
                        if (CurrentScan.IsMassSpectrum)
                        {
                            PointDataMap <SeemsPointAnnotation> .MapPair annotationPair = AnnotationSettings.ScanPointAnnotations.FindNear(pt.X, AnnotationSettings.ScanMatchTolerance);
                            if (annotationPair != null)
                            {
                                annotationX = annotationPair.Key;
                                annotation  = annotationPair.Value;
                                matchedAnnotations.Add(annotationPair);
                            }
                        }
                        else
                        {
                            PointDataMap <SeemsPointAnnotation> .MapPair annotationPair = AnnotationSettings.ChromatogramPointAnnotations.FindNear(pt.X, AnnotationSettings.ChromatogramMatchTolerance);
                            if (annotationPair != null)
                            {
                                annotationX = annotationPair.Key;
                                annotation  = annotationPair.Value;
                                matchedAnnotations.Add(annotationPair);
                            }
                        }

                        if (AnnotationSettings.ShowMatchedAnnotations && annotation != null)
                        {
                            pointLabel.AppendLine(annotation.Label);
                            pointColor = annotation.Color;
                            //if( curve is ZedGraph.StickItem )
                            {
                                ZedGraph.LineObj stickOverlay = new ZedGraph.LineObj(annotationX, 0, annotationX, pt.Y);
                                //stickOverlay.IsClippedToChartRect = true;
                                stickOverlay.Location.CoordinateFrame = ZedGraph.CoordType.AxisXYScale;
                                stickOverlay.Line.Width = annotation.Width;
                                stickOverlay.Line.Color = pointColor;
                                zedGraphControl1.GraphPane.GraphObjList.Add(stickOverlay);
                                dataLabels.Add(stickOverlay);
                                //( (ZedGraph.StickItem) curve ).Color = pointColor;
                                //( (ZedGraph.StickItem) curve ).Line.Width = annotation.Width;
                            }
                        }

                        if (CurrentScan.IsMassSpectrum)
                        {
                            if (AnnotationSettings.ShowScanPointMZs)
                            {
                                pointLabel.AppendLine(pt.X.ToString("f2"));
                            }
                            if (AnnotationSettings.ShowScanPointIntensities)
                            {
                                pointLabel.AppendLine(pt.Y.ToString("f2"));
                            }
                        }
                        else
                        {
                            if (AnnotationSettings.ShowChromatogramPointTimes)
                            {
                                pointLabel.AppendLine(pt.X.ToString("f2"));
                            }
                            if (AnnotationSettings.ShowChromatogramPointIntensities)
                            {
                                pointLabel.AppendLine(pt.Y.ToString("f2"));
                            }
                        }

                        string pointLabelString = pointLabel.ToString();
                        if (pointLabelString.Length == 0)
                        {
                            continue;
                        }

                        // Create a text label from the X data value
                        ZedGraph.TextObj text = new ZedGraph.TextObj(pointLabelString, pt.X, yAxis.Scale.ReverseTransform(yAxis.Scale.Transform(pt.Y) - 5),
                                                                     ZedGraph.CoordType.AxisXYScale, ZedGraph.AlignH.Center, ZedGraph.AlignV.Bottom);
                        text.ZOrder = ZedGraph.ZOrder.A_InFront;
                        //text.IsClippedToChartRect = true;
                        text.FontSpec.FontColor = pointColor;
                        // Hide the border and the fill
                        text.FontSpec.Border.IsVisible = false;
                        text.FontSpec.Fill.IsVisible   = false;
                        //text.FontSpec.Fill = new Fill( Color.FromArgb( 100, Color.White ) );
                        // Rotate the text to 90 degrees
                        text.FontSpec.Angle = 0;

                        string shape, coords;
                        text.GetCoords(pane, g, 1.0f, out shape, out coords);
                        if (shape != "poly")
                        {
                            throw new InvalidOperationException("shape must be 'poly'");
                        }
                        string[] textBoundsPointStrings = coords.Split(",".ToCharArray());
                        if (textBoundsPointStrings.Length != 9)
                        {
                            throw new InvalidOperationException("coords length must be 8");
                        }
                        Point[] textBoundsPoints = new Point[]
                        {
                            new Point(Convert.ToInt32(textBoundsPointStrings[0]), Convert.ToInt32(textBoundsPointStrings[1])),
                            new Point(Convert.ToInt32(textBoundsPointStrings[2]), Convert.ToInt32(textBoundsPointStrings[3])),
                            new Point(Convert.ToInt32(textBoundsPointStrings[4]), Convert.ToInt32(textBoundsPointStrings[5])),
                            new Point(Convert.ToInt32(textBoundsPointStrings[6]), Convert.ToInt32(textBoundsPointStrings[7]))
                        };
                        byte[] textBoundsPointTypes = new byte[]
                        {
                            (byte)PathPointType.Start,
                            (byte)PathPointType.Line,
                            (byte)PathPointType.Line,
                            (byte)PathPointType.Line
                        };
                        GraphicsPath textBoundsPath = new GraphicsPath(textBoundsPoints, textBoundsPointTypes);
                        textBoundsPath.CloseFigure();
                        Region textBoundsRegion = new Region(textBoundsPath);
                        textBoundsRegion.Intersect(pane.Chart.Rect);
                        RectangleF[] textBoundsRectangles = textBoundsRegion.GetRegionScans(g.Transform);

                        bool overlapDetected = false;
                        for (int j = 0; j < textBoundsRectangles.Length && !overlapDetected; ++j)
                        {
                            if (g.Clip.IsVisible(textBoundsRectangles[j]))
                            {
                                overlapDetected = true;
                            }

                            for (float y = textBoundsRectangles[j].Top; y <= textBoundsRectangles[j].Bottom && !overlapDetected; ++y)
                            {
                                for (float x = textBoundsRectangles[j].Left; x <= textBoundsRectangles[j].Right && !overlapDetected; ++x)
                                {
                                    if (gmap.GetPixel(Convert.ToInt32(x), Convert.ToInt32(y)).ToArgb() != pane.Chart.Fill.Color.ToArgb())
                                    {
                                        overlapDetected = true;
                                    }
                                }
                            }
                        }
                        if (!overlapDetected)
                        {
                            pane.GraphObjList.Add(text);
                            clipRegion.Union(textBoundsRegion);
                            //g.SetClip( chartRegion, CombineMode.Replace );
                            g.SetClip(clipRegion, CombineMode.Replace);
                            //clipG.Clear( Color.White );
                            //clipG.FillRegion( new SolidBrush( Color.Black ), g.Clip );
                            //clipBmp.Save( "C:\\clip.bmp" );
                            dataLabels.Add(text);
                            //text.Draw( g, pane, 1.0f );
                            //zedGraphControl1.DrawToBitmap( gmap, Rectangle.Round( pane.Rect ) );
                        }
                    }
                }

                if (AnnotationSettings.ShowUnmatchedAnnotations)
                {
                    PointDataMap <SeemsPointAnnotation> annotations;
                    if (CurrentScan.IsMassSpectrum)
                    {
                        annotations = AnnotationSettings.ScanPointAnnotations;
                    }
                    else
                    {
                        annotations = AnnotationSettings.ChromatogramPointAnnotations;
                    }

                    foreach (PointDataMap <SeemsPointAnnotation> .MapPair annotationPair in annotations)
                    {
                        if (matchedAnnotations.Contains(annotationPair))
                        {
                            continue;
                        }

                        float            stickLength  = (yAxis.MajorTic.Size * 2) / pane.Chart.Rect.Height;
                        ZedGraph.LineObj stickOverlay = new ZedGraph.LineObj(annotationPair.Key, 1, annotationPair.Key, -stickLength);
                        //stickOverlay.IsClippedToChartRect = true;
                        stickOverlay.Location.CoordinateFrame = ZedGraph.CoordType.XScaleYChartFraction;
                        stickOverlay.Line.Width = annotationPair.Value.Width;
                        stickOverlay.Line.Color = annotationPair.Value.Color;
                        zedGraphControl1.GraphPane.GraphObjList.Add(stickOverlay);
                        dataLabels.Add(stickOverlay);
                    }
                }
                g.Dispose();
            }
            else
            {
                // remove labels
            }
        }
        public void zedGraphLeftDown(PointF p)
        {
            ZedGraph.CurveItem curve;
            int index;
            bool isOnCurve = zedGraphPane.FindNearestPoint(p, zedGraphPane.CurveList, out curve, out index);

            disableEditOnGraph();
            if (!isOnCurve || graphic == null || graphic.getCurve() != curve)
            {
                double x, y;
                zedGraphPane.ReverseTransform(p, out x, out y);
                try
                {
                    graphic.addPoint(new ZedGraph.PointPair(x, y));
                    enableEditOnGraph();
                    oldPointPos = new ZedGraph.PointPair(x, y);
                }
                catch (InvalidPointPositon e)
                {
                    MessageBox.Show(e.Message);
                }
                catch (BarierIsFull e)
                {
                    MessageBox.Show(e.Message);
                }
                catch (BarierIntersection e)
                {
                    MessageBox.Show(e.Message);
                }
            }
            else if (graphic != null && graphic.getCurve() == curve)
            {
                enableEditOnGraph();
                oldPointPos = curve.Points[index];
                // Если первая или последняя точка интервала
                if (currentState.GetType().Name.Equals("InputProfilePoints")
                    && (index == 0 || index == curve.Points.Count - 1))
                {
                    // То разрешить редактирование только по Y
                    zedGraphControl.IsEnableHEdit = false;
                }
            }
            updateGraph();
        }
Esempio n. 8
0
        private void LoadGraph()
        {
            if (lineProductionDatas.Count <= 0)
            {
                MessageBox.Show("Unable to load data from server.", "Line efficiency daily graph", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            var bufferList = new List <ArticleProductionData>();

            var pane = new ZedGraph.GraphPane();

            pane.Title.Text               = "EFF con " + Line + "  (" + Department + ")";
            pane.YAxis.Title.Text         = "EFF %";
            pane.XAxis.Title.Text         = Month.ToString() + "/" + Year.ToString();
            pane.XAxis.MajorTic.IsAllTics = true;
            pane.XAxis.Scale.MajorStep    = 1;
            pane.XAxis.Scale.Min          = 1;
            pane.XAxis.Scale.Max          = 31;

            pane.Fill = new ZedGraph.Fill(Brushes.WhiteSmoke);

            ZedGraph.PointPairList list = new ZedGraph.PointPairList();

            foreach (var lineProduction in lineProductionDatas)
            {
                var workEff = Math.Round((lineProduction.Qty / lineProduction.Producibili) * 100.0, 1);

                list.Add(lineProduction.Datex.Day, workEff);
            }

            pane.GraphObjList.Clear();
            zedGraph.GraphPane.CurveList.Clear();

            var curve = new ZedGraph.LineItem("EFF %", list, Color.SteelBlue, ZedGraph.SymbolType.Circle);

            curve.Line.IsVisible     = true;
            curve.Symbol.Fill.Color  = Color.SteelBlue;
            curve.Symbol.Fill.Type   = ZedGraph.FillType.Solid;
            curve.Symbol.Size        = 10;
            curve.Line.Width         = 4;
            curve.Symbol.IsAntiAlias = true;
            curve.Line.IsSmooth      = false;
            curve.Line.IsAntiAlias   = true;
            curve.Line.Fill          = new ZedGraph.Fill(Color.White,
                                                         Color.LightSkyBlue, -45F);

            curve.Symbol.Size = 8.0F;
            curve.Symbol.Fill = new ZedGraph.Fill(Color.White);
            curve.Line.Width  = 2.0F;

            pane.XAxis.MajorTic.IsBetweenLabels = true;

            pane.Chart.Fill = new ZedGraph.Fill(Color.White, Color.FromArgb(250, 250, 250), 90F);
            pane.Fill       = new ZedGraph.Fill(Color.FromArgb(250, 250, 250));

            zedGraph.GraphPane    = pane;
            pane.Legend.IsVisible = false;
            ZedGraph.PointPairList articleRangeList = new ZedGraph.PointPairList();
            ZedGraph.LineItem      articleVertCurve = new ZedGraph.LineItem("");

            for (var i = 0; i <= curve.Points.Count - 1; i++)
            {
                ZedGraph.PointPair pt = curve.Points[i];

                ZedGraph.TextObj text = new ZedGraph.TextObj(pt.Y.ToString("f1"), pt.X, pt.Y,
                                                             ZedGraph.CoordType.AxisXYScale, ZedGraph.AlignH.Left, ZedGraph.AlignV.Center);
                text.ZOrder = ZedGraph.ZOrder.D_BehindAxis;
                text.FontSpec.Border.IsVisible = false;
                text.FontSpec.Fill.IsVisible   = false;
                text.FontSpec.Angle            = 90;
                pane.GraphObjList.Add(text);

                var art = articleProductions.LastOrDefault(x => x.Day == pt.X);
                var buf = bufferList.FirstOrDefault(x => x.Article == art.Article || x.Day == art.Day);


                if (art != null && buf == null)
                {
                    bufferList.Add(art);

                    ZedGraph.TextObj textArt = new ZedGraph.TextObj(art.Article, pt.X + 0.2f, pane.YAxis.Scale.Min + pt.Y / 2,
                                                                    ZedGraph.CoordType.AxisXYScale, ZedGraph.AlignH.Left, ZedGraph.AlignV.Center);

                    textArt.ZOrder = ZedGraph.ZOrder.D_BehindAxis;
                    textArt.FontSpec.Border.IsVisible = false;
                    textArt.FontSpec.Fill.IsVisible   = false;
                    textArt.FontSpec.Size             = 9;
                    textArt.FontSpec.FontColor        = Color.Black;

                    var lastArt = articleProductions.LastOrDefault(x => x.Day == pt.X - 1);
                    var nextArt = articleProductions.FirstOrDefault(x => x.Day == pt.X + 2);

                    if (lastArt != null && lastArt.Article != art.Article || nextArt != null && nextArt.Article != art.Article)
                    {
                        textArt.FontSpec.Angle = 90;
                    }
                    else
                    {
                        textArt.FontSpec.Angle = 0;
                    }

                    pane.GraphObjList.Add(textArt);

                    articleRangeList = new ZedGraph.PointPairList();
                    articleRangeList.Add(pt.X, pt.Y);
                    articleRangeList.Add(pt.X, pane.YAxis.Scale.Min);

                    var ac = new ZedGraph.LineItem(art.Article);
                    ac.Line.Style = System.Drawing.Drawing2D.DashStyle.Dot;
                    ac            = pane.AddCurve(art.Article, articleRangeList, Color.Orange, ZedGraph.SymbolType.None);
                }
            }

            zedGraph.GraphPane.CurveList.Add(curve);
            zedGraph.AxisChange();
            zedGraph.Refresh();

            zedGraph.IsShowPointValues = true;
            zedGraph.PointValueFormat  = "0";
            zedGraph.Invalidate();
        }