-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathChartWindow.xaml
86 lines (82 loc) · 5.32 KB
/
ChartWindow.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
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
<Window x:Class="HoppoPlugin.ChartWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
Title="ChartWindow" Height="300" Width="300" WindowState="Maximized" WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style x:Key="fuelStyle" TargetType="{x:Type chartingToolkit:DataPoint}">
<Setter Property="Background" Value="Green"/>
<Setter Property="Template" Value="{x:Null}"/>
</Style>
<Style x:Key="ammoStyle" TargetType="{x:Type chartingToolkit:DataPoint}">
<Setter Property="Background" Value="#FF8A360F"/>
<Setter Property="Template" Value="{x:Null}"/>
</Style>
<Style x:Key="steelStyle" TargetType="{x:Type chartingToolkit:DataPoint}">
<Setter Property="Background" Value="Gray"/>
<Setter Property="Template" Value="{x:Null}"/>
</Style>
<Style x:Key="bauxiteStyle" TargetType="{x:Type chartingToolkit:DataPoint}">
<Setter Property="Background" Value="#FFC76114"/>
<Setter Property="Template" Value="{x:Null}"/>
</Style>
</Window.Resources>
<Grid>
<chartingToolkit:Chart Name="LineChart1" Margin="0,0,0,-60" Title="资源统计图">
<chartingToolkit:LineSeries Name="Fuel"
Title="燃油"
DependentValuePath="countOfMat"
IndependentValuePath="DateOF"
ItemsSource="{Binding [0]}"
IsSelectionEnabled="True"
DataPointStyle="{StaticResource fuelStyle}">
<!--<chartingToolkit:LineSeries.Background>
<RadialGradientBrush Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
<GradientStop Color="#FFB9D6F7"/>
<GradientStop Color="#FF038B22" Offset="1"/>
</RadialGradientBrush>
</chartingToolkit:LineSeries.Background>-->
</chartingToolkit:LineSeries>
<chartingToolkit:LineSeries Name="Ammo"
Title="弹药"
DependentValuePath="countOfMat"
IndependentValuePath="DateOF"
ItemsSource="{Binding [1]}"
IsSelectionEnabled="True" DataPointStyle="{StaticResource ammoStyle}">
<!--<chartingToolkit:LineSeries.Background>
<RadialGradientBrush Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
<GradientStop Color="#FFFBB7B5"/>
<GradientStop Color="#FF8A360F" Offset="1"/>
</RadialGradientBrush>
</chartingToolkit:LineSeries.Background>-->
</chartingToolkit:LineSeries>
<chartingToolkit:LineSeries Name="Steel"
Title="钢材"
DependentValuePath="countOfMat"
IndependentValuePath="DateOF"
ItemsSource="{Binding [2]}"
IsSelectionEnabled="True" DataPointStyle="{StaticResource steelStyle}">
<!--<chartingToolkit:LineSeries.Background>
<RadialGradientBrush Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
<GradientStop Color="#FFB8C0AC"/>
<GradientStop Color="#FF808A87" Offset="1"/>
</RadialGradientBrush>
</chartingToolkit:LineSeries.Background>-->
</chartingToolkit:LineSeries>
<chartingToolkit:LineSeries Name="Bauxite"
Title="铝土"
DependentValuePath="countOfMat"
IndependentValuePath="DateOF"
ItemsSource="{Binding [3]}"
IsSelectionEnabled="True" DataPointStyle="{StaticResource bauxiteStyle}">
<!--<chartingToolkit:LineSeries.Background>
<RadialGradientBrush Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
<GradientStop Color="#FFFDE79C"/>
<GradientStop Color="#FFC76114" Offset="1"/>
</RadialGradientBrush>
</chartingToolkit:LineSeries.Background>-->
</chartingToolkit:LineSeries>
</chartingToolkit:Chart>
</Grid>
</Window>