Пример #1
0
        /// <summary>
        /// Clones the logarithmic axis.
        /// </summary>
        /// <param name="obj">The Object</param>
        /// <returns>Returns the cloned axis.</returns>
        protected override DependencyObject CloneAxis(DependencyObject obj)
        {
            var logarithmicAxis3D = new LogarithmicAxis3D();

            logarithmicAxis3D.Interval        = this.Interval;
            logarithmicAxis3D.Minimum         = this.Minimum;
            logarithmicAxis3D.Maximum         = this.Maximum;
            logarithmicAxis3D.LogarithmicBase = this.LogarithmicBase;
            obj = logarithmicAxis3D;
            return(base.CloneAxis(obj));
        }
Пример #2
0
        /// <summary>
        /// Calculates the base actual range.
        /// </summary>
        /// <returns>Returns the base actual range.</returns>
        private DoubleRange CalculateBaseActualRange()
        {
            if (this.Area != null)
            {
                foreach (var series in Area.VisibleSeries.OfType <XyDataSeries>())
                {
                    if (series.ActualYAxis == this && series.YValues.Count > 0 && (double.IsNaN(series.YValues.Min()) || series.YValues.Min() <= 0))
                    {
                        series.YRange = LogarithmicAxis3D.GetRange(series.YValues as List <double>, series.YRange.End);
                    }

                    var xValues = series.ActualXValues as List <double>;

                    if (xValues != null && (series.ActualXAxis == this && xValues.Count > 0 && ((double.IsNaN(xValues.Min())) || xValues.Min() <= 0)))
                    {
                        series.XRange = LogarithmicAxis3D.GetRange(xValues, series.XRange.End);
                    }
                }

                return(Area.VisibleSeries.OfType <ISupportAxes>()
                       .Select(
                           series =>
                {
                    if (series.ActualXAxis == this)
                    {
                        return series.XRange;
                    }

                    if (series.ActualYAxis == this)
                    {
                        return series.YRange;
                    }

                    return DoubleRange.Empty;
                }).Sum());
            }

            return(DoubleRange.Empty);
        }