Example #1
0
        internal override object GetCombineGroupKey(DataPoint point)
        {
            object value = point.GetValueForAxis(this);

            if (value != null)
            {
                return(value);
            }

            return(base.GetCombineGroupKey(point));
        }
Example #2
0
        /// <summary>
        /// Gets the stack sum value for each DataPoint in a stack group used by a CombineStrategy.
        /// The result is the transformed value of the stack sum of the DataPoint values.
        /// </summary>
        /// <param name="point">The data point.</param>
        /// <param name="transformedStackSumValue">The transformed value of the stack sum of the DataPoint values.</param>
        /// <param name="positive">Determines whether the point value is positive relative to the plot origin.</param>
        /// <param name="positiveValuesSum">The present sum of positive DataPoint values in the stack. Updated if the DataPoint value is positive.</param>
        /// <param name="negativeValuesSum">The present sum of negative DataPoint values in the stack. Updated if the DataPoint value is negative.</param>
        /// <returns>Value that indicates whether the <paramref name="transformedStackSumValue"/> is calculated successfully.</returns>
        internal override bool TryGetStackSumValue(DataPoint point, out double transformedStackSumValue, out bool positive, ref double positiveValuesSum, ref double negativeValuesSum)
        {
            double doubleValue = DefaultOrigin;

            if (!point.isEmpty)
            {
                var objectValue = point.GetValueForAxis(this);
                if (!(objectValue is Range))
                {
                    doubleValue = (double)objectValue;
                }
            }

            double transformedValue = this.TransformValue(doubleValue);

            if (double.IsNaN(transformedValue))
            {
                // Invalid state
                transformedStackSumValue = double.NaN;
                positive = false;

                return(false);
            }

            positive = transformedValue >= DefaultOrigin;
            if (positive)
            {
                positiveValuesSum       += doubleValue;
                transformedStackSumValue = this.TransformValue(positiveValuesSum);
            }
            else
            {
                negativeValuesSum       += doubleValue;
                transformedStackSumValue = this.TransformValue(negativeValuesSum);
            }

            return(true);
        }
Example #3
0
 internal virtual object GetCategoryValue(DataPoint point)
 {
     return(point.GetValueForAxis(this));
 }