/// <summary> /// Updates the axes to include the max and min of this series. /// </summary> protected internal void UpdateAxisMaxMin() { XAxis.Include(MinX); XAxis.Include(MaxX); YAxis.Include(MinY); YAxis.Include(MaxY); foreach (var child in Children) { child.UpdateAxisMaxMin(); } }
/// <summary> /// Updates the Max/Min limits from the specified point list. /// </summary> /// <param name="pts">The PTS.</param> protected void InternalUpdateMaxMin(IList <DataPoint> pts) { if (pts == null || pts.Count == 0) { return; } double minx = MinX; double miny = MinY; double maxx = MaxX; double maxy = MaxY; foreach (var pt in pts) { if (!IsValidPoint(pt, XAxis, YAxis)) { continue; } if (pt.x < minx || double.IsNaN(minx)) { minx = pt.x; } if (pt.x > maxx || double.IsNaN(maxx)) { maxx = pt.x; } if (pt.y < miny || double.IsNaN(miny)) { miny = pt.y; } if (pt.y > maxy || double.IsNaN(maxy)) { maxy = pt.y; } } MinX = minx; MinY = miny; MaxX = maxx; MaxY = maxy; XAxis.Include(MinX); XAxis.Include(MaxX); YAxis.Include(MinY); YAxis.Include(MaxY); }
protected override void UpdateMaxMin() { base.UpdateMaxMin(); DataPoint[] allPoints = Areas.SelectMany(a => a).ToArray(); if (!allPoints.Any()) { return; } MinX = allPoints.Min(p => p.X); MaxX = allPoints.Max(p => p.X); MinY = allPoints.Min(p => p.Y); MaxY = allPoints.Max(p => p.Y); XAxis.Include(MinX); XAxis.Include(MaxX); YAxis.Include(MinY); YAxis.Include(MaxY); }