Esempio n. 1
0
        void IRequireDataSourceUpdates.Add(IChartRenderContext icrc, int startAt, IList items)
        {
            if (CategoryAxis == null || ValueAxis == null)
            {
                return;
            }
            if (BindPaths == null || !BindPaths.IsValid)
            {
                return;
            }
            var recycler = new Recycler <Path, ItemState <Path> >(new List <Path>(), CreatePath);
            var reproc   = IncrementalAdd <ItemState <Path> >(startAt, items, ItemState, (ix, item) => {
                var valueO = BindPaths.OpenFor(item);
                var valueH = BindPaths.HighFor(item);
                var valueL = BindPaths.LowFor(item);
                var valueC = BindPaths.CloseFor(item);
                // short-circuit if it's NaN
                if (double.IsNaN(valueO) || double.IsNaN(valueH) || double.IsNaN(valueL) || double.IsNaN(valueC))
                {
                    return(null);
                }
                var valuex = BindPaths.CategoryFor(item, ix);
                // add requested item
                var istate = ElementPipeline(ix, valuex, valueO, valueH, valueL, valueC, item, recycler, BindPaths.bvl);
                return(istate);
            }, (rpc, istate) => {
                istate.Shift(rpc, BindPaths, CategoryAxis, UpdateGeometry);
            });

            ReconfigureLimits();
            // finish up
            Layer.Add(recycler.Created);
            Dirty = false;
            RaiseItemsUpdated(ItemUpdates, icrc, NotifyCollectionChangedAction.Add, startAt, reproc);
        }
        void IRequireDataSourceUpdates.Add(IChartRenderContext icrc, int startAt, IList items)
        {
            if (CategoryAxis == null || ValueAxis == null)
            {
                return;
            }
            if (BindPaths == null || !BindPaths.IsValid)
            {
                return;
            }
            var recycler = new Recycler <Path, ItemState <Path> >(CreatePath);
            var reproc   = IncrementalAdd <ItemState <Path> >(startAt, items, ItemState, (ix, item) => {
                var valuey = BindPaths.ValueFor(item);
                // short-circuit if it's NaN
                if (double.IsNaN(valuey))
                {
                    return(null);
                }
                var valuex = BindPaths.CategoryFor(item, ix);
                // add requested item
                var istate = ElementPipeline(ix, valuex, valuey, item, recycler, BindPaths);
                return(istate);
            }, (rpc, istate) => {
                istate.Shift(rpc, BindPaths, CategoryAxis, null);
                // NO geometry update; done in later stages of render pipeline
            });

            ReconfigureLimits();
            // finish up
            Layer.Add(recycler.Created);
            Dirty = false;
            RaiseItemsUpdated(ItemUpdates, icrc, NotifyCollectionChangedAction.Add, startAt, reproc);
        }
Esempio n. 3
0
        void IRequireDataSourceUpdates.Add(IChartRenderContext icrc, int startAt, IList items)
        {
            if (CategoryAxis == null || ValueAxis == null)
            {
                return;
            }
            if (BindPaths == null || !BindPaths.IsValid)
            {
                return;
            }
            var recycler = new Recycler <Path, SeriesItemState>(new List <Path>(), CreatePath);
            var reproc   = IncrementalAdd <SeriesItemState>(startAt, items, ItemState, (ix, item) => {
                var valuex = BindPaths.CategoryFor(item, ix);
                // add requested item
                var istate = ElementPipeline(ix, valuex, item, recycler, BindPaths);
                return(istate);
            }, (rpc, istate) => {
                istate.Shift(rpc, BindPaths, CategoryAxis, UpdateGeometry);
            });

            ReconfigureLimits();
            // finish up
            Layer.Add(recycler.Created);
            Dirty = false;
            RaiseItemsUpdated(ItemUpdates, icrc, NotifyCollectionChangedAction.Add, startAt, reproc);
        }