private void ClearAndAddDatas(object sender, RoutedEventArgs e) { viewmodel.Collection.Clear(); viewmodel.Collection.Add(new Model() { XValue = "Jul", YValue = new List<double> { 21, 23, 24, 25, 26, 27, 28, 30, 34, 36, 38 } }); viewmodel.Collection.Add(new Model() { XValue = "Aug", YValue = new List<double> { 26, 28, 29, 30, 32, 33, 35, 36, 52 } }); viewmodel.Collection.Add(new Model() { XValue = "Sep", YValue = new List<double> { 28, 29, 30, 31, 32, 34, 35, 36 } }); viewmodel.Collection.Add(new Model() { XValue = "Oct", YValue = new List<double> { 27, 26, 28, 29, 29, 29, 32, 35, 32, 38, 53 } }); viewmodel.Collection.Add(new Model() { XValue = "Nov", YValue = new List<double> { 25, 30, 45, 50, 52, 32, 60 } }); viewmodel.Collection.Add(new Model() { XValue = "Dec", YValue = new List<double> { 26, 27, 28, 30, 32, 34, 35, 37, 35, 37, 45 } }); chart.Series[0].ItemsSource = viewmodel.Collection; } |