SfChart chart = new SfChart();
RangeColumnSeries rangeSeries = new RangeColumnSeries();
rangeSeries.ItemsSource = new ViewModel().Collection;
rangeSeries.XBindingPath = "XValue";
rangeSeries.High = "High";
rangeSeries.Low = "Low";
chart.Series.Add(rangeSeries);
ViewModel.CS
public class ViewModel
{
public ObservableCollection<Model> Collection { get; set; }
public ViewModel()
{
Collection = new ObservableCollection<Model>();
Collection.Add(new Model() { XValue = 1, High = 604, Low = 595 });
Collection.Add(new Model() { XValue = 2, High = 602, Low = 595 });
Collection.Add(new Model() { XValue = 3, High = 608, Low = 594 });
Collection.Add(new Model() { XValue = 4, High = 619, Low = 604 });
Collection.Add(new Model() { XValue = 5, High = 608, Low = 594 });
}
}
|