/// <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> /// The update data. /// </summary> protected internal override void UpdateData() { if (this.ItemsSource == null) { return; } var points = this.Points; points.Clear(); // Use the mapping to generate the points if (this.Mapping != null) { foreach (var item in this.ItemsSource) { points.Add(this.Mapping(item)); } return; } // Get DataPoints from the items in ItemsSource // if they implement IScatterPointProvider // If DataFields are set, this is not used /*if (DataFieldX == null || DataFieldY == null) * { * foreach (var item in ItemsSource) * { * var idpp = item as IScatterPointProvider; * if (idpp == null) * { * continue; * } * * points.Add(idpp.GetScatterPoint()); * } * * return; * }*/ var dest = new List <IDataPoint>(); // Using reflection to add points var filler = new ListFiller <ScatterPoint>(); filler.Add(this.DataFieldX, (item, value) => item.X = Convert.ToDouble(value)); filler.Add(this.DataFieldY, (item, value) => item.Y = Convert.ToDouble(value)); filler.Add(this.DataFieldSize, (item, value) => item.Size = Convert.ToDouble(value)); filler.Add(this.DataFieldValue, (item, value) => item.Value = Convert.ToDouble(value)); filler.Add(this.DataFieldTag, (item, value) => item.Tag = value); filler.Fill(dest, this.ItemsSource); this.Points = dest; }
/// <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; } var dest = new List <T>(); // Using reflection to add points var filler = new ListFiller <T>(); filler.Add(this.ValueField, (item, value) => item.Value = Convert.ToDouble(value)); filler.Add(this.ColorField, (item, value) => item.Color = (OxyColor)value); filler.Fill(dest, this.ItemsSource); this.Items = dest; }
/// <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); }
/// <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); }