void item_Checked(object sender, RoutedEventArgs e)
{
try
{
var pc = ((FrameworkElement)sender).DataContext as PropertyCheck;
LineSeries ls = new LineSeries();
ls.Title = pc.Name;
ls.IndependentValuePath = "Time";
ls.DependentValuePath = pc.Name;
ls.Name = pc.Name;
ls.IsSelectionEnabled = true;
ls.IndependentAxis = dta1;
//Style labelstyle = new Style(typeof(DateTimeAxisLabel));
//labelstyle.Setters.Add(new Setter(DateTimeAxisLabel.HoursIntervalStringFormatProperty, "{0}"));
//((DateTimeAxis)ls.IndependentAxis).AxisLabelStyle = labelstyle;
// Customize datapoint
//var dpstyle = App.Current.Resources["LineDataPointStyle1"] as Style;
//var newstyle = new Style();
//newstyle.BasedOn=dpstyle;
//newstyle.TargetType = typeof(LineDataPoint);
//newstyle.Setters.Add(
// new Setter(
// Control.BackgroundProperty,
// GetRandomBrush()));
//ls.DataPointStyle = newstyle;
ls.OverridesDefaultStyle = false;
ls.ItemsSource = _olist;
ls.IsSelectionEnabled = true;
ls.SelectionChanged += new SelectionChangedEventHandler(ls_SelectionChanged);
chart0.Series.Add(ls);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}