Esempio n. 1
0
        /// <summary>
        /// Updates the data.
        /// </summary>
        protected internal override void UpdateData()
        {
            if (this.ItemsSource == null)
            {
                return;
            }

            this.items.Clear();

            // Use the mapping to generate the points
            if (this.Mapping != null)
            {
                foreach (var item in this.ItemsSource)
                {
                    this.items.Add(this.Mapping(item));
                }

                return;
            }

            var filler = new ListFiller <HighLowItem>();

            filler.Add(this.DataFieldX, (p, v) => p.X         = this.ToDouble(v));
            filler.Add(this.DataFieldHigh, (p, v) => p.High   = this.ToDouble(v));
            filler.Add(this.DataFieldLow, (p, v) => p.Low     = this.ToDouble(v));
            filler.Add(this.DataFieldOpen, (p, v) => p.Open   = this.ToDouble(v));
            filler.Add(this.DataFieldClose, (p, v) => p.Close = this.ToDouble(v));
            filler.FillT(this.items, this.ItemsSource);
        }
        /// <summary>
        /// Updates the data.
        /// </summary>
        protected internal override void UpdateData()
        {
            if (this.ItemsSource != null)
            {
                this.Items.Clear();

                var filler = new ListFiller <IntervalBarItem>();
                filler.Add(this.MinimumField, (item, value) => item.Start = Convert.ToDouble(value));
                filler.Add(this.MaximumField, (item, value) => item.End   = Convert.ToDouble(value));
                filler.FillT(this.Items, this.ItemsSource);
            }
        }
        /// <summary>
        /// Updates the data.
        /// </summary>
        protected internal override void UpdateData()
        {
            if (this.ItemsSource == null)
            {
                return;
            }

            this.slices.Clear();

            var filler = new ListFiller <PieSlice>();

            filler.Add(this.LabelField, (item, value) => item.Label           = Convert.ToString(value));
            filler.Add(this.ValueField, (item, value) => item.Value           = Convert.ToDouble(value));
            filler.Add(this.ColorField, (item, value) => item.Fill            = (OxyColor)value);
            filler.Add(this.IsExplodedField, (item, value) => item.IsExploded = (bool)value);
            filler.FillT(this.slices, this.ItemsSource);
        }
Esempio n. 4
0
        /// <summary>
        /// The add scatter points.
        /// </summary>
        /// <param name="dest">
        /// The dest.
        /// </param>
        /// <param name="itemsSource">
        /// The items source.
        /// </param>
        /// <param name="dataFieldX">
        /// The data field x.
        /// </param>
        /// <param name="dataFieldY">
        /// The data field y.
        /// </param>
        /// <param name="dataFieldSize">
        /// The data field size.
        /// </param>
        /// <param name="dataFieldValue">
        /// The data field value.
        /// </param>
        /// <param name="dataFieldTag">
        /// The data field tag.
        /// </param>
        protected void AddScatterPoints(
            IList <ScatterPoint> dest,
            IEnumerable itemsSource,
            string dataFieldX,
            string dataFieldY,
            string dataFieldSize,
            string dataFieldValue,
            string dataFieldTag)
        {
            var filler = new ListFiller <ScatterPoint>();

            filler.Add(dataFieldX, (item, value) => item.X         = Convert.ToDouble(value));
            filler.Add(dataFieldY, (item, value) => item.Y         = Convert.ToDouble(value));
            filler.Add(dataFieldSize, (item, value) => item.Size   = Convert.ToDouble(value));
            filler.Add(dataFieldValue, (item, value) => item.Value = Convert.ToDouble(value));
            filler.Add(dataFieldTag, (item, value) => item.Tag     = value);
            filler.FillT(dest, itemsSource);
        }