Exemple #1
0
        protected internal void EnsureAxisMargins()
        {
            if (!this.IsDirty)
            {
                return;
            }
            this.SeriesMarginInfos.Clear();
            AxisMargin marginResult = AxisMargin.Empty;

            if (this.Axis.Scale != null && this.Axis.Orientation == AxisOrientation.X)
            {
                EnumerableFunctions.ForEach <KeyValuePair <int, AxisMargin> >(Enumerable.Select <IGrouping <int, Series>, KeyValuePair <int, AxisMargin> >(Enumerable.GroupBy <Series, int>(this.ChartArea.FindSeries(this.Axis), (Func <Series, int>)(series => series.ClusterKey)), (Func <IGrouping <int, Series>, KeyValuePair <int, AxisMargin> >)(seriesGroup => new KeyValuePair <int, AxisMargin>(seriesGroup.Key, ((XYSeriesPresenter)Enumerable.FirstOrDefault <Series>((IEnumerable <Series>)seriesGroup).SeriesPresenter).GetSeriesMarginInfo(this.Axis.IsMarginVisible)))), (Action <KeyValuePair <int, AxisMargin> >)(info => this.SeriesMarginInfos.Add(info.Key, info.Value)));
                if (!(this.Axis.Scale is CategoryScale))
                {
                    EnumerableFunctions.ForEach <KeyValuePair <int, AxisMargin> >((IEnumerable <KeyValuePair <int, AxisMargin> >) this.SeriesMarginInfos, (Action <KeyValuePair <int, AxisMargin> >)(info => marginResult = marginResult.Extend(info.Value)));
                    AxisMargin axisMargin = new AxisMargin(this.Axis.Scale.ProjectedStartMargin, this.Axis.Scale.ProjectedEndMargin);
                    marginResult = new AxisMargin(Math.Max(0.0, marginResult.Start - axisMargin.Start), Math.Max(0.0, marginResult.End - axisMargin.End));
                }
            }
            this.AggregatedSeriesMargins = new AxisMargin(marginResult.Start * (1.0 - marginResult.Start), marginResult.End * (1.0 - marginResult.End));
            this.IsDirty = false;
        }
Exemple #2
0
 protected internal void EnsureAxisMargins()
 {
     if (!this.IsDirty)
         return;
     this.SeriesMarginInfos.Clear();
     AxisMargin marginResult = AxisMargin.Empty;
     if (this.Axis.Scale != null && this.Axis.Orientation == AxisOrientation.X)
     {
         EnumerableFunctions.ForEach<KeyValuePair<int, AxisMargin>>(Enumerable.Select<IGrouping<int, Series>, KeyValuePair<int, AxisMargin>>(Enumerable.GroupBy<Series, int>(this.ChartArea.FindSeries(this.Axis), (Func<Series, int>)(series => series.ClusterKey)), (Func<IGrouping<int, Series>, KeyValuePair<int, AxisMargin>>)(seriesGroup => new KeyValuePair<int, AxisMargin>(seriesGroup.Key, ((XYSeriesPresenter)Enumerable.FirstOrDefault<Series>((IEnumerable<Series>)seriesGroup).SeriesPresenter).GetSeriesMarginInfo(this.Axis.IsMarginVisible)))), (Action<KeyValuePair<int, AxisMargin>>)(info => this.SeriesMarginInfos.Add(info.Key, info.Value)));
         if (!(this.Axis.Scale is CategoryScale))
         {
             EnumerableFunctions.ForEach<KeyValuePair<int, AxisMargin>>((IEnumerable<KeyValuePair<int, AxisMargin>>)this.SeriesMarginInfos, (Action<KeyValuePair<int, AxisMargin>>)(info => marginResult = marginResult.Extend(info.Value)));
             AxisMargin axisMargin = new AxisMargin(this.Axis.Scale.ProjectedStartMargin, this.Axis.Scale.ProjectedEndMargin);
             marginResult = new AxisMargin(Math.Max(0.0, marginResult.Start - axisMargin.Start), Math.Max(0.0, marginResult.End - axisMargin.End));
         }
     }
     this.AggregatedSeriesMargins = new AxisMargin(marginResult.Start * (1.0 - marginResult.Start), marginResult.End * (1.0 - marginResult.End));
     this.IsDirty = false;
 }