Exemplo n.º 1
0
        private IEnumerable <KeyValuePair <int, T> > IndexData(SeriesConfiguration <T> config)
        {
            var f = config.Chart.ZoomingAxis == AxisTags.X
                        ? config.XValueMapper
                        : config.YValueMapper;

            var isObservable = typeof(IObservableChartPoint).IsAssignableFrom(typeof(T));

            var i = 0;

            foreach (var t in this)
            {
                if (isObservable)
                {
                    var observable = t as IObservableChartPoint;
                    if (observable != null)
                    {
                        observable.PointChanged -= ObservableOnPointChanged;
                        observable.PointChanged += ObservableOnPointChanged;
                    }
                }
                //I think this config.chart.from and config.chart.to is not anymor useful
                //this is causing an issue with double.nan values.
                //becase double.nan is not in the range chart.From-chart.To
                //for now this is disabled and will be rivewed with Highperformance Release
                //var pulled = f(t, i);
                //if (pulled >= config.Chart.From && pulled <= config.Chart.To)
                yield return(new KeyValuePair <int, T>(i, t));

                i++;
            }
        }
Exemplo n.º 2
0
        private IEnumerable <KeyValuePair <int, T> > IndexData(SeriesConfiguration <T> config)
        {
            var f = config.Chart.ZoomingAxis == AxisTags.X
                        ? config.XValueMapper
                        : config.YValueMapper;

            var isObservalbe = typeof(IObservableChartPoint).IsAssignableFrom(typeof(T));

            var i = 0;

            foreach (var t in this)
            {
                // this is why you only use IObservalbe if really needed,
                // or when you have a small amouth of points
                if (isObservalbe)
                {
                    var observable = t as IObservableChartPoint;
                    if (observable != null)
                    {
                        observable.ValueChanged += ObservableOnValueChanged;
                    }
                }
                if (f(t, i) >= config.Chart.From && f(t, i) <= config.Chart.To)
                {
                    yield return(new KeyValuePair <int, T>(i, t));
                }
                i++;
            }
        }
Exemplo n.º 3
0
 public SeriesCollection()
 {
     Configuration      = new SeriesConfiguration <double>().X((v, i) => i).Y(v => v);
     CollectionChanged += (sender, args) =>
     {
         if (args.NewItems != null)
         {
             foreach (var series in args.NewItems.Cast <Series>())
             {
                 series.Collection = this;
             }
         }
     };
 }
Exemplo n.º 4
0
 public SeriesCollection Setup <T>(SeriesConfiguration <T> config)
 {
     Configuration = config;
     return(this);
 }