예제 #1
0
 public void AddMarker(PlotMarker marker)
 {
     if (MarkerList == null)
     {
         MarkerList = new List <PlotMarker>();
     }
     MarkerList.Add(marker);
 }
예제 #2
0
 private void DrawMarker(Graphics g, PlotMarker marker)
 {
     using (Pen markerPen = new Pen(Color.Empty))
     {
         markerPen.Color = marker.Color;
         markerPen.Width = marker.Thickness;
         if (marker.Type == PlotMarkerType.HorizontalLine)
         {
             float yPlot      = GetPixelYatY(marker.Level);
             float xPlotStart = ownerControl.GetPixelXatX(marker.Start);
             float xPlotEnd   = ownerControl.GetPixelXatX(marker.End);
             g.DrawLine(markerPen, xPlotStart, yPlot, xPlotEnd, yPlot);
         }
         else if (marker.Type == PlotMarkerType.VerticalLine)
         {
             float xPlot      = ownerControl.GetPixelXatX(marker.Level);
             float yPlotStart = GetPixelYatY(marker.Start);
             float yPlotEnd   = GetPixelYatY(marker.End);
             g.DrawLine(markerPen, xPlot, yPlotStart, xPlot, yPlotEnd);
         }
     }
 }