GraphStyle.xaml 4.34 KB
Newer Older
1 2 3 4
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf">
5

6 7 8 9
    <!--颜色-->
    <SolidColorBrush x:Key="TextBrush" Color="#4C4949" />
    <SolidColorBrush x:Key="GrayBrush1" Color="#FF727272"/>
    <SolidColorBrush x:Key="GrayBrush2" Color="#FF858484" />
10 11 12
    <!--在图表中描述字符串的透明背景-->
    <SolidColorBrush x:Key="TextTransparentBackgroundBrush" Color="#99FFFFFF"/>

13 14 15 16 17 18
    <SolidColorBrush x:Key="SemiTransparentGreyBrush2" Color="#99FFFFFF"/>
    <SolidColorBrush x:Key="SemiTransparentGreyBrush" Color="#99F0F0F0"/>
    <SolidColorBrush x:Key="SemiTransparentActiveBrush" Color="#50008BE5"/>
    <SolidColorBrush x:Key="WhiteBrush" Color="White"/>

    <!--尺寸-->
19 20
    <sys:Double x:Key="FontSize.Title">15</sys:Double>
    <sys:Double x:Key="FontSize.Value">15</sys:Double>
21 22
    <sys:Double x:Key="FontSize.Unit">15</sys:Double>

23 24
    <Thickness x:Key="TextMargin">2.5 0</Thickness>

25 26 27 28
    <sys:Double x:Key="GraphInfoRowMaxHeight">20</sys:Double>
    <sys:Double x:Key="GraphInfo2RowMaxHeight">40</sys:Double>
    <sys:Double x:Key="GraphInfo3RowMaxHeight">60</sys:Double>
    <sys:Double x:Key="GraphInfo4RowMaxHeight">80</sys:Double>
29 30 31

    <!--字体-->
    <Style x:Key="TitleStyle" TargetType="TextBlock">
32
        <Setter Property="Padding" Value="5,2"/>
33 34 35 36 37 38 39 40
        <Setter Property="Width" Value="50"/>
        <Setter Property="Foreground" Value="{StaticResource GrayBrush1}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize.Title}"/>
        <Setter Property="TextAlignment" Value="Right"/>
    </Style>
    <Style x:Key="ValueStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize.Value}"/>
41
        <Setter Property="Padding" Value="5,2"/>
42 43 44 45 46 47 48 49
    </Style>
    <Style x:Key="UnitStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource GrayBrush2}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize.Unit}"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
    </Style>

    <!--Axis.Section-->
50
    <!--图表中选择器-->
51 52 53 54 55 56 57
    <Style x:Key="Styles.Axis.Section.Selected" TargetType="lvc:AxisSection" >
        <Setter Property="StrokeThickness" Value="1"/>
        <Setter Property="DataLabel" Value="False"/>
        <Setter Property="DisableAnimations" Value="True"/>
        <Setter Property="DataLabelForeground" Value="White"/>
        <Setter Property="Opacity" Value="0.1"/>

58 59
        <Setter Property="Stroke" Value="#40CA000C"/>
        <Setter Property="Fill" Value="#20CA000C"/>
60 61 62 63 64 65 66 67 68 69
    </Style>

    <!--图表中放大用选择器-->
    <Style x:Key="Styles.Axis.Section.Selected.ZoomIn" TargetType="lvc:AxisSection" >
        <Setter Property="StrokeThickness" Value="1"/>
        <Setter Property="DataLabel" Value="True"/>
        <Setter Property="DisableAnimations" Value="True"/>
        <Setter Property="DataLabelForeground" Value="White"/>
        <Setter Property="Opacity" Value="0.5"/>
        <Setter Property="Stroke" Value="{StaticResource MahApps.Brushes.Accent}"/>
70 71 72 73 74 75 76 77 78 79 80
    </Style>

    <!--扫描图,纵向趋势图Y轴 标签-->
    <Style x:Key="AxisSectionStyle" TargetType="lvc:AxisSection" >
        <Setter Property="StrokeThickness" Value="1"/>
        <Setter Property="DataLabel" Value="True"/>
        <Setter Property="DisableAnimations" Value="True"/>
        <Setter Property="DataLabelForeground" Value="White"/>
        <Setter Property="Opacity" Value="0.5"/>
        <Setter Property="Panel.ZIndex" Value="1"/>
    </Style>
81 82 83 84 85 86 87 88 89 90 91

    <!--扫描图,纵向趋势图Y轴 标签 公差,目标值,上下限-->
    <Style x:Key="Styles.Axis.Section.Tolerance" TargetType="lvc:AxisSection" >
        <Setter Property="StrokeThickness" Value="1"/>
        <Setter Property="DataLabel" Value="True"/>
        <Setter Property="DisableAnimations" Value="True"/>
        <Setter Property="DataLabelForeground" Value="White"/>
        <Setter Property="Opacity" Value="0.5"/>
        <Setter Property="Panel.ZIndex" Value="1"/>
        <Setter Property="StrokeDashArray" Value="3"/>
    </Style>
92
</ResourceDictionary>