Ejemplo n.º 1
0
        private void UpdateDynamicSeries()
        {
            if (!this.IsTemplateApplied)
            {
                return;
            }

            // clean-up existing dynamic series
            for (int i = this.SeriesInternal.Count - 1; i >= 0; i--)
            {
                ChartSeries series = this.SeriesInternal[i] as ChartSeries;
                if (ChartSeriesProvider.GetIsDynamicSeries(series))
                {
                    this.SeriesInternal.RemoveAt(i);
                }
            }

            var seriesProvider = this.SeriesProvider;

            if (seriesProvider == null)
            {
                return;
            }

            // add all the series provided by the current series provider
            foreach (var series in seriesProvider.CreateSeries())
            {
                this.SeriesInternal.Add(series);
            }
        }
Ejemplo n.º 2
0
        private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ChartSeriesProvider provider = d as ChartSeriesProvider;

            provider.DetachSourceEvents();
            provider.sourceAsEnumerable = provider.GetSourceAsEnumerable();
            provider.AttachSourceEvents();

            provider.NotifyListeners();
        }
Ejemplo n.º 3
0
        private static void OnSeriesProviderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RadChartBase chart = d as RadChartBase;

            ChartSeriesProvider oldProvider = e.OldValue as ChartSeriesProvider;

            if (oldProvider != null)
            {
                oldProvider.RemoveListener(chart);
            }

            ChartSeriesProvider newProvider = e.NewValue as ChartSeriesProvider;

            if (newProvider != null)
            {
                newProvider.AddListener(chart);
            }

            chart.UpdateDynamicSeries();
        }
 /// <summary>
 /// Selects the desired descriptor, depending on the context specified and the owning <see cref="ChartSeriesProvider"/> instance.
 /// </summary>
 public virtual ChartSeriesDescriptor SelectDescriptor(ChartSeriesProvider provider, object context)
 {
     return(null);
 }