public GraphObjTag(ChromGraphItem chromGraphItem, GraphObjType graphObjType, ScaledRetentionTime start, ScaledRetentionTime end) { ChromGraphItem = chromGraphItem; GraphObjType = graphObjType; StartTime = start; EndTime = end; }
private void AddRetentionTimeAnnotation(MSGraphPane graphPane, Graphics g, GraphObjList annotations, PointF ptTop, string title, GraphObjType graphObjType, Color color, ScaledRetentionTime retentionTime) { // ReSharper disable LocalizableElement string label = string.Format("{0}\n{1:F01}", title, retentionTime.DisplayTime); // ReSharper restore LocalizableElement FontSpec fontLabel = CreateFontSpec(color, _fontSpec.Size); SizeF sizeLabel = fontLabel.MeasureString(g, label, graphPane.CalcScaleFactor()); PointF realTopPoint = ptTop; ptTop = new PointF(0, ptTop.Y + sizeLabel.Height + 15); float chartHeightWithLabel = graphPane.Chart.Rect.Height + sizeLabel.Height + 15; double intensityChartFraction = (ptTop.Y - realTopPoint.Y) / chartHeightWithLabel; LineObj stick = new LineObj(color, retentionTime.DisplayTime, intensityChartFraction, retentionTime.DisplayTime, 1) { IsClippedToChartRect = true, Location = { CoordinateFrame = CoordType.XScaleYChartFraction }, ZOrder = ZOrder.E_BehindCurves, Line = { Width = 1 }, Tag = new GraphObjTag(this, graphObjType, retentionTime), }; annotations.Add(stick); ptTop = new PointF(0, ptTop.Y - 5); intensityChartFraction = (ptTop.Y - realTopPoint.Y) / chartHeightWithLabel; TextObj text = new TextObj(label, retentionTime.DisplayTime, intensityChartFraction, CoordType.XScaleYChartFraction, AlignH.Center, AlignV.Bottom) { IsClippedToChartRect = true, ZOrder = ZOrder.E_BehindCurves, FontSpec = CreateFontSpec(color, _fontSpec.Size), Tag = new GraphObjTag(this, graphObjType, retentionTime), }; annotations.Add(text); }
private void AddPeakBoundaries(GraphPane graphPane, ICollection <GraphObj> annotations, bool best, ScaledRetentionTime startTime, ScaledRetentionTime endTime, double maxIntensity) { // Only show boundaries for dragging when boundaries turned off if (!Settings.Default.ShowPeakBoundaries && (!best || DragInfo == null)) { return; } float xStart = graphPane.XAxis.Scale.Transform(startTime.DisplayTime); float xEnd = graphPane.XAxis.Scale.Transform(endTime.DisplayTime); // Hide boundaries, if they are too close together if (xEnd - xStart <= MIN_BOUNDARY_DISPLAY_WIDTH) { // But not if they are currently part of a drag operation. if (DragInfo == null) { return; } } // Make sure the best borders are visible if (best) { float yMax = graphPane.YAxis.Scale.Transform(maxIntensity); float yZero = graphPane.YAxis.Scale.Transform(0); if (yZero - yMax < MIN_BEST_BOUNDARY_HEIGHT) { maxIntensity = graphPane.YAxis.Scale.ReverseTransform(yZero - MIN_BEST_BOUNDARY_HEIGHT); } } // Summary graphs show only the best peak boundaries else if (_isSummary) { return; } Color colorBoundaries = (best ? COLOR_BOUNDARIES_BEST : COLOR_BOUNDARIES); GraphObjType graphObjType = best ? GraphObjType.best_peak : GraphObjType.peak; // Make sure to get maximum intensity within the peak range, // as this is not guaranteed to be the center of the peak LineObj stickStart = new LineObj(colorBoundaries, startTime.DisplayTime, maxIntensity, startTime.DisplayTime, 0) { IsClippedToChartRect = true, Location = { CoordinateFrame = CoordType.AxisXYScale }, ZOrder = ZOrder.B_BehindLegend, Line = { Width = 1, Style = DashStyle.Dash }, Tag = new GraphObjTag(this, graphObjType, startTime), }; annotations.Add(stickStart); LineObj stickEnd = new LineObj(colorBoundaries, endTime.DisplayTime, maxIntensity, endTime.DisplayTime, 0) { IsClippedToChartRect = true, Location = { CoordinateFrame = CoordType.AxisXYScale }, ZOrder = ZOrder.B_BehindLegend, Line = { Width = 1, Style = DashStyle.Dash }, Tag = new GraphObjTag(this, graphObjType, endTime), }; annotations.Add(stickEnd); }
public GraphObjTag(ChromGraphItem chromGraphItem, GraphObjType graphObjType, ScaledRetentionTime retentionTime) { ChromGraphItem = chromGraphItem; GraphObjType = graphObjType; RetentionTime = retentionTime; }
private void AddRetentionTimeAnnotation(MSGraphPane graphPane, Graphics g, GraphObjList annotations, PointF ptTop, string title, GraphObjType graphObjType, Color color, ScaledRetentionTime retentionTime) { string label = string.Format("{0}\n{1:F01}", title, retentionTime.DisplayTime); // Not L10N FontSpec fontLabel = CreateFontSpec(color, _fontSpec.Size); SizeF sizeLabel = fontLabel.MeasureString(g, label, graphPane.CalcScaleFactor()); PointF realTopPoint = ptTop; ptTop = new PointF(0, ptTop.Y + sizeLabel.Height + 15); float chartHeightWithLabel = graphPane.Chart.Rect.Height + sizeLabel.Height + 15; double intensityChartFraction = (ptTop.Y - realTopPoint.Y) / chartHeightWithLabel; LineObj stick = new LineObj(color, retentionTime.DisplayTime, intensityChartFraction, retentionTime.DisplayTime, 1) { IsClippedToChartRect = true, Location = { CoordinateFrame = CoordType.XScaleYChartFraction }, ZOrder = ZOrder.E_BehindCurves, Line = { Width = 1 }, Tag = new GraphObjTag(this, graphObjType, retentionTime), }; annotations.Add(stick); ptTop = new PointF(0, ptTop.Y - 5); intensityChartFraction = (ptTop.Y - realTopPoint.Y) / chartHeightWithLabel; TextObj text = new TextObj(label, retentionTime.DisplayTime, intensityChartFraction, CoordType.XScaleYChartFraction, AlignH.Center, AlignV.Bottom) { IsClippedToChartRect = true, ZOrder = ZOrder.E_BehindCurves, FontSpec = CreateFontSpec(color, _fontSpec.Size), Tag = new GraphObjTag(this, graphObjType, retentionTime), }; annotations.Add(text); }