Exemplo n.º 1
0
        public void SetGraph()
        {
            pltMain.Series.Clear();
            NonDisplayedSeries.Clear();
            innerStack.Children.Clear();
            DateTime dMin = OPoints.Min(x => x.Date);

            dtAxis = new DateTimeAxis {
                Position = OxyPlot.Axes.AxisPosition.Bottom, Minimum = dMin.Date.ToOADate(), Maximum = DateTime.Today.ToOADate(), StringFormat = "M/d"
            };
            dtAxis.FirstDateTime = dMin.Date;
            dtAxis.LastDateTime  = DateTime.Today;
            PrefixedLineSeries   = new List <PrefixedLineSeries>();
            OUsers.ForEach(x => PrefixedLineSeries.Add(OPoints.ToDailyPoints(x.Alias)));
            OUsers.ForEach(x => PrefixedLineSeries.Add(OPoints.ToHourlyDatePoints(x.Alias)));
            OUsers.ForEach(x => PrefixedLineSeries.Add(OPoints.ToTotalAvg(x.Alias)));
            OUsers.ForEach(x => PrefixedLineSeries.Add(OPoints.ToWeeklyAvg(x.Alias)));
            foreach (var PrefLine in PrefixedLineSeries.OrderBy(x => x.Title))
            {
                pltMain.Series.Add(PrefLine.LineSeries);
                CheckBox checkBox = new CheckBox()
                {
                    Name      = PrefLine.Key,
                    Content   = PrefLine.Title,
                    IsChecked = true
                };
                checkBox.Click += new RoutedEventHandler(this.Combo_Clicked);
                innerStack.Children.Add(checkBox);
            }
            RefreshGraph();
        }
Exemplo n.º 2
0
 private void Refresh()
 {
     LoadFile(FileName);
     OUsers.ForEach(x => GetUserPoints(x));
     SetGraph();
     SaveFile(FileName);
 }