public override void SetData(ChartPoint BottomLeft, ChartPoint RightTop, ChartPoint hipoint, ChartPoint loPoint, bool isBull) { this.cdpBottomLeft = BottomLeft; this.cdpRightTop = RightTop; this.hiPoint = hipoint; this.loPoint = loPoint; this.isFill = (cdpRightTop.Y < cdpBottomLeft.Y); if (!isFill) { this.hiPoint1 = new ChartPoint(hiPoint.X, cdpRightTop.Y); this.loPoint1 = new ChartPoint(loPoint.X, cdpBottomLeft.Y); } else { this.hiPoint1 = new ChartPoint(hiPoint.X, cdpBottomLeft.Y); this.loPoint1 = new ChartPoint(loPoint.X, cdpRightTop.Y); } this.IsBull = isBull; var alignedValues = AlignHiLoSegment(cdpBottomLeft.Y, cdpRightTop.Y, hiPoint.Y, loPoint.Y); this.hiPoint.Y = alignedValues[0]; this.loPoint.Y = alignedValues[1]; XRange = DoubleRange.Union(new double[] { BottomLeft.X, RightTop.X, hipoint.X, loPoint.X }); //Candle Series show empty point set to false and IsTransposed to true exception thrown/WPF-14327 if (!double.IsNaN(BottomLeft.Y) || !double.IsNaN(RightTop.Y) || !double.IsNaN(hipoint.Y) || !double.IsNaN(loPoint.Y)) { YRange = DoubleRange.Union(new double[] { BottomLeft.Y, RightTop.Y, hipoint.Y, loPoint.Y }); } else { YRange = DoubleRange.Empty; } }
/// <summary> /// Sets the values for this segment. This method is not /// intended to be called explicitly outside the Chart but it can be overridden by /// any derived class. /// </summary> /// <param name="Values">The Column Segment Values</param> public override void SetData(params double[] Values) { this.X = Values[0]; this.Y = Values[1]; this.startDepth = Values[2]; this.endDepth = Values[3]; if (!double.IsNaN(X)) { XRange = DoubleRange.Union(X); } else { XRange = DoubleRange.Empty; } if (!double.IsNaN(Y)) { YRange = DoubleRange.Union(Y); } else { YRange = DoubleRange.Empty; } ZRange = new DoubleRange(startDepth, endDepth); }
protected internal DoubleRange GetYRange(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { DoubleRange range = DoubleRange.Union(new double[] { y1, y2, y3, y4 }); double cy = 3 * (y2 - y1); double by = 3 * (y3 - y3) - cy; double ay = y4 - y1 - by - cy; double r1, r2; if (ChartMath.SolveQuadraticEquation(3 * ay, 2 * by, cy, out r1, out r2)) { if (r1 >= 0 && r1 <= 1) { double y = ay * r1 * r1 * r1 + by * r1 * r1 + cy * r1 + y1; range = DoubleRange.Union(range, y); } if (r2 >= 0 && r2 <= 1) { double y = ay * r2 * r2 * r2 + by * r2 * r2 + cy * r2 + y1; range = DoubleRange.Union(range, y); } } return(range); }
/// <summary> /// Sets the values for this segment. This method is not /// intended to be called explicitly outside the Chart but it can be overridden by /// any derived class. /// </summary> /// <param name="Values"></param> public override void SetData(params double[] Values) { this.highValue = Values[1]; this.lowValue = Values[2]; this.xVal = Values[0]; XRange = new DoubleRange(Values[0], Values[0]); if (!double.IsNaN(Values[1]) || !double.IsNaN(Values[2])) { YRange = DoubleRange.Union(Values[1], Values[2]); } else { YRange = DoubleRange.Empty; } }
/// <summary> /// Sets the values for this segment. This method is not /// intended to be called explicitly outside the Chart but it can be overriden by /// any derived class. /// </summary> /// <param name="Values"></param> public override void SetData(params double[] Values) { XData = Values[0]; YData = Values[1]; xPos = Values[0]; yPos = Values[1]; if (!double.IsNaN(xPos)) { XRange = DoubleRange.Union(xPos); } else { XRange = DoubleRange.Empty; } if (!double.IsNaN(yPos)) { YRange = DoubleRange.Union(yPos); } else { YRange = DoubleRange.Empty; } }