/// <summary> /// Get the tool tip for a RangePolygon /// There are two types, BottomToolTip and TopToolTip /// A RangePolygon that is BOTTOM RANGETYPE will return the BottomToolTip /// wherease a TOP RANGETYPE will return the TopToolTip /// </summary> /// <param name="polygonIndex">index of the polygon</param> /// <returns>see summary</returns> private string GetToolTip(int polygonIndex) { RangePolygon polygon = GetRangePolygon(polygonIndex); if (polygon.RangeType == RangePolygon.RANGETYPE.BOTTOM) { return(this.BottomToolTip); } else { return(this.TopToolTip); } }
/// <summary> /// Gets all the RangePolygons between line1 and line2. /// </summary> /// <param name="cg">used for getting absolute values</param> /// <param name="line1">the line that has the 'good' values</param> /// <param name="line2">the line that has the 'bad' values </param> private void FillRangePolygons(ChartGraphics cg, Series line1, Series line2) { this.ClearRangePolygons(); //System.Console.WriteLine("GetRangePolygons Start: " + DateTime.Now.Millisecond); DataPoint[] dpIntersections = LineUtils.GetAllIntersections(line1, line2); //ArrayList rPolygons = new ArrayList(); if (dpIntersections != null) { switch (dpIntersections.Length) { case 0: //this is where tehre is no intersection break; case 1: //this is the special case that there is only one intersection RangePolygon sPolygon = GetStartPolygon(cg, line1, line2, dpIntersections[0], this.rPolygons.Count); if (sPolygon != null) { rPolygons.Add(sPolygon); } RangePolygon ePolygon = GetEndPolygon(cg, line1, line2, dpIntersections[dpIntersections.Length - 1], this.rPolygons.Count); if (ePolygon != null) { rPolygons.Add(ePolygon); } break; default: if (dpIntersections.Length >= 0) { RangePolygon startPolygon = GetStartPolygon(cg, line1, line2, dpIntersections[0], this.rPolygons.Count); if (startPolygon != null) { rPolygons.Add(startPolygon); } for (int dpInterIndex = 0; dpInterIndex < dpIntersections.Length - 1; dpInterIndex++) { RangePolygon rp = GetPolygonOfIntersection(cg, line1, line2, dpIntersections[dpInterIndex], dpIntersections[dpInterIndex + 1], this.rPolygons.Count); if (rp != null) { rPolygons.Add(rp); } } RangePolygon endPolygon = GetEndPolygon(cg, line1, line2, dpIntersections[dpIntersections.Length - 1], this.rPolygons.Count); if (endPolygon != null) { rPolygons.Add(endPolygon); } } else { break; } //System.Console.WriteLine("GetRangePolygons END: " + DateTime.Now.Millisecond); break; } } }