Example #1
0
        private NumericalAxisRangePlotInfo CreateAxisRangePlotInfo(double delta, Range rangeValue)
        {
            NumericalAxisRangePlotInfo plotInfo;
            double normalizedHigh, normalizedLow;

            if (delta == 0)
            {
                normalizedHigh = 0;
                normalizedLow  = 0;
            }
            else
            {
                normalizedHigh = (rangeValue.High - this.actualRange.minimum) / delta;
                normalizedLow  = (rangeValue.Low - this.actualRange.minimum) / delta;
            }

            if (normalizedHigh < normalizedLow)
            {
                normalizedLow = normalizedHigh;
            }

            plotInfo = NumericalAxisRangePlotInfo.Create(this, this.normalizedOrigin, normalizedHigh, normalizedLow, this.normalizedOrigin);
            plotInfo.SnapTickIndex     = this.GetSnapTickIndex(rangeValue.High);
            plotInfo.SnapBaseTickIndex = this.GetSnapTickIndex(rangeValue.Low);

            return(plotInfo);
        }
Example #2
0
        internal override void SetValueFromAxis(AxisModel axis, object value)
        {
            // ChartSeries labels rely on isPositive to flip alignment, so isPositive is set to true by default
            this.isPositive = true;

            if (axis is NumericalAxisModel)
            {
                this.numericalPlot      = value as NumericalAxisRangePlotInfo;
                this.isInNumericalRange = true;
            }
            else if (axis is CategoricalAxisModel || axis is DateTimeContinuousAxisModel)
            {
                this.categoricalPlot      = value as CategoricalAxisPlotInfo;
                this.isInCategoricalRange = true;
            }
        }