<pi:UserControlBase x:Class="智慧物流软件系统.DataChartView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:智慧物流软件系统"
             xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
             mc:Ignorable="d" 
             xmlns:hc="https://handyorg.github.io/handycontrol"
             xmlns:pi="https://github.com/ping9719/wpfex"
             d:DesignHeight="450" d:DesignWidth="800" LoadedVisibleFirst="loadFirst">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <!--筛选栏-->
        <Grid Margin="5,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <UniformGrid Grid.Column="0" Columns="2">
                <ComboBox Margin="5" ItemsSource="{Binding Year}" SelectedIndex="{Binding YearIndex}" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Placeholder="请选择年份" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="年份"></ComboBox>
                <ComboBox Margin="5" ItemsSource="{Binding Month}" SelectedIndex="{Binding MonthIndex}" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Placeholder="请选择月份" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="月份"></ComboBox>
            </UniformGrid>
            <hc:UniformSpacingPanel Grid.Column="1" Spacing="5">
                <Button Command="{Binding ButStatChartCommand}" Style="{StaticResource ButtonDefault}" Width="70" >刷新</Button>
            </hc:UniformSpacingPanel>
        </Grid>
        <hc:LoadingLine VerticalAlignment="Top" IsRunning="{Binding IsLoad}" Visibility="{Binding IsLoad,Converter={StaticResource Boolean2VisibilityConverter}}"/>
        <!--图表栏-->
        <lvc:CartesianChart Grid.Row="1" Grid.ColumnSpan="3" LegendLocation="Top" >
            <!--内容-->
            <lvc:CartesianChart.Series>
                <lvc:LineSeries LineSmoothness="0.3" Stroke="DeepSkyBlue" Title="总数量" Values="{Binding ChartValues1}" DataLabels="True"></lvc:LineSeries>
                <lvc:LineSeries LineSmoothness="0.3" Stroke="LimeGreen" Title="合格数量" Values="{Binding ChartValues2}" DataLabels="False"></lvc:LineSeries>
                <lvc:LineSeries LineSmoothness="0.3" Stroke="OrangeRed" Title="不合格数量" Values="{Binding ChartValues3}" DataLabels="False"></lvc:LineSeries>
            </lvc:CartesianChart.Series>
            <!--x轴-->
            <lvc:CartesianChart.AxisX>
                <!--<lvc:Axis Title="日期" LabelFormatter="{Binding LabelFormatterX}"></lvc:Axis>-->
                <lvc:Axis Title="日期" Labels="{Binding ChartLabelsX}">
                    <!--显示所有的列-->
                    <lvc:Axis.Separator>
                        <lvc:Separator Step="1"></lvc:Separator>
                    </lvc:Axis.Separator>
                </lvc:Axis>
            </lvc:CartesianChart.AxisX>
            <!--y轴-->
            <lvc:CartesianChart.AxisY>
                <!--<lvc:Axis Title="数量" LabelFormatter="{Binding LabelFormatterY}"></lvc:Axis>-->
                <lvc:Axis Title="数量" MinValue="0"></lvc:Axis>
            </lvc:CartesianChart.AxisY>
        </lvc:CartesianChart>
    </Grid>
</pi:UserControlBase>
