-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraph.xaml
56 lines (52 loc) · 2.83 KB
/
Graph.xaml
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
<ui:FluentWindow x:Class="PowerTray.Graph"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PowerTray"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
mc:Ignorable="d"
Title="PowerTray Graphs" Height="420" Width="680" MinHeight="350" MinWidth="350"
ExtendsContentIntoTitleBar="True"
WindowBackdropType="Mica"
WindowCornerPreference="Round"
WindowStartupLocation="CenterScreen">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ui:TitleBar
Title="PowerTray Graphs"
FontWeight="Bold"
FontSize="20"
Grid.Row="0"
Height="35"
Icon="pack://application:,,,/Assets/applicationIcon-256.png" />
<ui:Card Visibility="Visible" Margin="10,5,10,0" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Row="1">
<lvc:CartesianChart DisableAnimations="False" Series="{Binding SeriesCollection}" LegendLocation="Top" >
<lvc:CartesianChart.DataTooltip>
<lvc:DefaultTooltip CornerRadius="10" Background="Gray"/>
</lvc:CartesianChart.DataTooltip>
<lvc:CartesianChart.AxisY>
<lvc:Axis Title="Power Draw (Watts)" MinValue="0" LabelFormatter="{Binding YFormatter}"></lvc:Axis>
</lvc:CartesianChart.AxisY>
<lvc:CartesianChart.AxisX>
<lvc:Axis Title="Time (seconds)" Labels="{Binding Labels}"></lvc:Axis>
</lvc:CartesianChart.AxisX>
</lvc:CartesianChart>
</ui:Card>
<Grid x:Name="BottomControls" Grid.Row = "2" Margin="0,8,0,8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button x:Name="ResetButton" Grid.Column="0" Width ="100" Click = "ResetButton_Click" HorizontalAlignment="Center">Clear Data</Button>
<ui:Badge x:Name="AdminWarning" Grid.Column="1" Content="⚠️ Admin rights might be required to graph CPU power" HorizontalAlignment="Center" Height="30"/>
<Button x:Name="CloseButton" Grid.Column="2" Width ="100" Click ="CloseButton_Click" HorizontalAlignment="Center">Close</Button>
</Grid>
</Grid>
</ui:FluentWindow>