public override void DrawSeriesAndAxis(FivePointNine.Windows.Graphics.Graphics2 g) { if (dsCollection == null) { return; } string YUnit = dsCollection[0].YUnits.Name; string unit = dsCollection[0].YUnits.Unit; bool noUnit = false; for (int i = 1; i < dsCollection.Count; i++) { if (!dsCollection[i].Enabled) { continue; } if (unit != dsCollection[i].YUnits.Unit) { noUnit = true; break; } if (!YUnit.Contains(dsCollection[i].YUnits.Name)) { YUnit += ", " + dsCollection[i].YUnits.Name; } } if (noUnit) { YUnit = "Error -- Incompatible units"; } else { YUnit += " (" + dsCollection[0].YUnits.Unit + ")"; } var yLabelSz = g.MeasureString(YUnit, Font); var xLabelSz = g.MeasureString(XUnit, Font); YLabelWidth = yLabelSz.Height * 2; XLabelHeight = xLabelSz.Height * 2; g.Clip = new Region(DrawPlotArea); g.DrawString(YUnit, Font, Color.Black, Width - YLabelWidth / 2 * 1.5F, (Height - XLabelHeight) / 2 + yLabelSz.Width / 2, -90); g.DrawString(XUnit, Font, Color.Black, (Width - YLabelWidth) / 2, Height - XLabelHeight * 1.5F / 2.0F); g.SmoothingMode = SmoothingMode.AntiAlias; foreach (var DataSeries in dsCollection.SeriesList) { if (DataSeries != null) { if (DataSeries.Enabled) { if (DataSeries != HoverOver) { DataSeries.Draw(g, (int)DrawPlotArea.Width, (int)(Height - XLabelHeight), xOffsetG, yOffsetG, XPPU, YPPU, false); } } } } if (HoverOver != null) { HoverOver.Draw(g, (int)DrawPlotArea.Width, (int)DrawPlotArea.Height, xOffsetG, yOffsetG, XPPU, YPPU, false); } g.Clip = new Region(new RectangleF(0, 0, Width, Height)); }