GraphStyle.xaml 3.68 KB
Newer Older
1 2 3 4 5 6 7 8 9
<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">
    
    <!--颜色-->
    <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 25 26
    <Thickness x:Key="TextMargin">2.5 0</Thickness>

    <sys:Double x:Key="GraphInfoRowMaxHeight">19</sys:Double>
    <sys:Double x:Key="GraphInfo2RowMaxHeight">38</sys:Double>
27 28 29

    <!--字体-->
    <Style x:Key="TitleStyle" TargetType="TextBlock">
30
        <Setter Property="Padding" Value="5,2"/>
31 32 33 34 35 36 37 38
        <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}"/>
39
        <Setter Property="Padding" Value="5,2"/>
40 41 42 43 44 45 46 47
    </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-->
48
    <!--图表中选择器-->
49 50 51 52 53 54 55 56 57 58 59
    <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"/>

        <Setter Property="Stroke" Value="#FFCA000C"/>
        <Setter Property="Fill" Value="#59CA000C"/>
    </Style>

60 61 62 63 64 65 66 67 68 69
    <!--图表中放大用选择器-->
    <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}"/>
    </Style>
    
70 71 72 73 74 75 76 77 78 79
    <!--扫描图,纵向趋势图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>
</ResourceDictionary>