internal static Tuple<DataValueType, DataValueType, bool, object> GetSeriesKey(StackedColumnSeries series)
 {
     DataValueType dataValueType = series.ActualYValueType;
     if (dataValueType == DataValueType.Auto)
     {
         if (series.ChartArea != null)
         {
             XYSeries xySeries = (XYSeries)Enumerable.FirstOrDefault<ColumnSeries>(Enumerable.OfType<ColumnSeries>((IEnumerable)series.ChartArea.GetSeries()), (Func<ColumnSeries, bool>)(s => s.ActualYValueType != DataValueType.Auto));
             if (xySeries != null)
                 dataValueType = xySeries.ActualYValueType;
         }
         if (dataValueType == DataValueType.Auto && series.ActualYDataRange.HasData)
         {
             dataValueType = ValueHelper.GetDataValueType((object)series.ActualYDataRange.Minimum);
         }
         else
         {
             series.UpdateActualValueTypes();
             dataValueType = series.ActualYValueType;
         }
     }
     if (dataValueType == DataValueType.Integer)
         dataValueType = DataValueType.Float;
     return new Tuple<DataValueType, DataValueType, bool, object>(dataValueType, series.ActualXValueType, series.IsHundredPercent, series.GroupingKey);
 }
        private bool IsHundredPercent(Series series)
        {
            StackedColumnSeries stackedColumnSeries = series as StackedColumnSeries;

            if (stackedColumnSeries == null)
            {
                return(true);
            }
            if (stackedColumnSeries != null)
            {
                return(stackedColumnSeries.ActualIsHundredPercent);
            }
            return(false);
        }
Example #3
0
        protected override void UpdateActualPropertiesFromDataPoint(string propertyName)
        {
            base.UpdateActualPropertiesFromDataPoint(propertyName);
            if (!(propertyName == "YValuePercent"))
            {
                return;
            }
            StackedColumnSeries stackedColumnSeries = this.Series as StackedColumnSeries;

            if (stackedColumnSeries == null || !stackedColumnSeries.ActualIsHundredPercent)
            {
                return;
            }
            this.UpdateActualLabelContent();
        }
        internal override void BindViewToDataPoint(DataPoint dataPoint, FrameworkElement view, string valueName)
        {
            base.BindViewToDataPoint(dataPoint, view, valueName);
            StackedColumnSeries    stackedColumnSeries    = dataPoint.Series as StackedColumnSeries;
            StackedColumnDataPoint stackedColumnDataPoint = dataPoint as StackedColumnDataPoint;
            LabelControl           labelControl           = view as LabelControl;

            if (labelControl == null || stackedColumnDataPoint == null || (stackedColumnSeries == null || !stackedColumnSeries.ActualIsHundredPercent) || !(valueName == "ActualLabelContent") && valueName != null)
            {
                return;
            }
            double yvaluePercent = stackedColumnDataPoint.YValuePercent;

            if (Math.Abs(yvaluePercent) < 0.005)
            {
                labelControl.Content = (object)null;
            }
            else
            {
                labelControl.Content = (object)yvaluePercent.ToString("P0", (IFormatProvider)CultureInfo.CurrentCulture);
            }
        }
 public StackedColumnSeriesPresenter(StackedColumnSeries series)
     : base((XYSeries)series)
 {
 }
 public StackedColumnSeriesPresenter(StackedColumnSeries series)
     : base((XYSeries)series)
 {
 }
        internal static Tuple <DataValueType, DataValueType, bool, object> GetSeriesKey(StackedColumnSeries series)
        {
            DataValueType dataValueType = series.ActualYValueType;

            if (dataValueType == DataValueType.Auto)
            {
                if (series.ChartArea != null)
                {
                    XYSeries xySeries = (XYSeries)Enumerable.FirstOrDefault <ColumnSeries>(Enumerable.OfType <ColumnSeries>((IEnumerable)series.ChartArea.GetSeries()), (Func <ColumnSeries, bool>)(s => s.ActualYValueType != DataValueType.Auto));
                    if (xySeries != null)
                    {
                        dataValueType = xySeries.ActualYValueType;
                    }
                }
                if (dataValueType == DataValueType.Auto && series.ActualYDataRange.HasData)
                {
                    dataValueType = ValueHelper.GetDataValueType((object)series.ActualYDataRange.Minimum);
                }
                else
                {
                    series.UpdateActualValueTypes();
                    dataValueType = series.ActualYValueType;
                }
            }
            if (dataValueType == DataValueType.Integer)
            {
                dataValueType = DataValueType.Float;
            }
            return(new Tuple <DataValueType, DataValueType, bool, object>(dataValueType, series.ActualXValueType, series.IsHundredPercent, series.GroupingKey));
        }