-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathDashboard.xaml.cs
98 lines (97 loc) · 3.62 KB
/
Dashboard.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using LiveCharts;
using LiveCharts.Defaults;
using LiveCharts.Wpf;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Social_Blade_Dashboard
{
/// <summary>
/// Interaction logic for Dashboard.xaml
/// </summary>
public partial class Dashboard : UserControl
{
public SeriesCollection SeriesCollection { get; set; }
public SeriesCollection LastHourSeries { get; set; }
public SeriesCollection LastHourSeries1 { get; set; }
public string[] Labels { get; set; }
public Func<double,string> Formatter { get; set; }
public Dashboard()
{
InitializeComponent();
SeriesCollection = new SeriesCollection
{
new StackedColumnSeries
{
Values = new ChartValues<double> {25,52,61,89},
StackMode = StackMode.Values,
DataLabels = true
},
new StackedColumnSeries
{
Values = new ChartValues<double> {-15,-75,-16,-49},
StackMode = StackMode.Values,
DataLabels = true
}
};
LastHourSeries = new SeriesCollection
{
new LineSeries
{
AreaLimit = -10,
Values = new ChartValues<ObservableValue>
{
new ObservableValue(3),
new ObservableValue(1),
new ObservableValue(9),
new ObservableValue(4),
new ObservableValue(5),
new ObservableValue(3),
new ObservableValue(1),
new ObservableValue(2),
new ObservableValue(3),
new ObservableValue(7),
}
}
};
LastHourSeries1 = new SeriesCollection
{
new LineSeries
{
AreaLimit = -10,
Values = new ChartValues<ObservableValue>
{
new ObservableValue(13),
new ObservableValue(11),
new ObservableValue(9),
new ObservableValue(14),
new ObservableValue(5),
new ObservableValue(3),
new ObservableValue(12),
new ObservableValue(2),
new ObservableValue(3),
new ObservableValue(7),
}
}
};
Labels = new[] { "Feb 7", "Feb 8", "Feb 9", "Feb 10" };
Formatter = value => value.ToString();
DataContext = this;
string imgCartoon = $"{Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.ToString()}\\Images\\cartoon-woman-pretty.png";
string imgavatar = $"{Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.ToString()}\\Images\\avatar1.jpg";
ImgCartoon.Source = new BitmapImage(new Uri(imgCartoon));
avatar1.Source = new BitmapImage(new Uri(imgavatar));
avatar2.Source = new BitmapImage(new Uri(imgavatar));
}
}
}