-
Notifications
You must be signed in to change notification settings - Fork 0
/
graph.xaml.cs
63 lines (54 loc) · 2.26 KB
/
graph.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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.Shapes;
using System.Windows.Controls.DataVisualization.Charting;
using BE;
using BL;
namespace PLWPF
{
/// <summary>
/// Interaction logic for graph.xaml
/// </summary>
public partial class graph : Window
{
IBL myBL = FactoryBl.GetBl();
public graph()
{
InitializeComponent();
IBL myBL = FactoryBl.GetBl();
}
private void graph_Loaded(object sender, RoutedEventArgs e)
{
Dictionary<string, int> data = new Dictionary<string, int>();
foreach (var item in myBL.GroupHostingUnitByNumOfPeople().AllKeysInGroup())
data.Add(item.ToString(), myBL.GroupHostingUnitByNumOfPeople().AllElementsForKey(item).Count());
((ColumnSeries)num.Series[0]).ItemsSource = data;
Dictionary<string, int> data1 = new Dictionary<string, int>();
foreach (var item in myBL.GroupByAreaOfUnit().AllKeysInGroup())
data1.Add(item.ToString(), myBL.GroupByAreaOfUnit().AllElementsForKey(item).Count());
((ColumnSeries)area.Series[0]).ItemsSource = data1;
Dictionary<string, int> data2 = new Dictionary<string, int>();
foreach (var item in myBL.GroupByTypeOfUnits().AllKeysInGroup())
data2.Add(item.ToString(), myBL.GroupByTypeOfUnits().AllElementsForKey(item).Count());
((ColumnSeries)type.Series[0]).ItemsSource = data2;
Dictionary<string, int> data3 = new Dictionary<string, int>();
foreach (var item in myBL.GroupByNumOfClosedOrders().AllKeysInGroup())
data3.Add(item.ToString(), myBL.GroupByNumOfClosedOrders().AllElementsForKey(item).Count());
((ColumnSeries)closed.Series[0]).ItemsSource = data3;
}
private void buttn_x_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}