<Page x:Class="DashboardWPF.Analysis"
      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:DashboardWPF"
      xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
      xmlns:flexChart="clr-namespace:C1.WPF.Chart;assembly=C1.WPF.FlexChart.4"
      xmlns:res="clr-namespace:DashboardWPF.Strings"
      mc:Ignorable="d" ShowsNavigationUI="False"
      d:DesignHeight="1080" d:DesignWidth="1920"
      Title="Analysis" Loaded="OnLoaded">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/DashboardWPF;component/Style/Style.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Page.Resources>
    <Grid Style="{DynamicResource RootGrid}" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="3*"/>
            <RowDefinition x:Name="ScaleRow" Height="2*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition x:Name="ScaleColumn" Width="3*"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>
        <TextBlock Margin="5" Grid.ColumnSpan="2" Style="{DynamicResource Tilte}" Text="{x:Static res:Resource.AnalysisPage_Title}"/>
        <Border Grid.Row="1" Grid.RowSpan="2" Margin="0,10,5,5"  Style="{DynamicResource TileBorder}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="5*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Margin="10" Style="{DynamicResource TilePanelTitleText}" Grid.ColumnSpan="2" Text="{x:Static res:Resource.ProductWise_Header}"/>
                <c1:C1OlapPanel x:Name="OlapPanel" Grid.Row="1" Margin="5,5,2.5,5" />
                <c1:C1OlapGrid x:Name="OlapGrid" Grid.Row="1" Grid.Column="2" Margin="2.5,5,5,5" />
            </Grid>
        </Border>
        <Border Grid.Row="1" Grid.Column="1" Margin="5,10,0,5"  Style="{DynamicResource TileBorder}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Margin="10" Style="{DynamicResource TilePanelTitleText}" Text="{x:Static res:Resource.RegionWise_Header}" />
                    <Button x:Name="Scale" Grid.Column="1" Visibility="Visible" HorizontalAlignment="Right" Margin="5" Width="30" Content="&#xE92D;" FontSize="20" RenderTransformOrigin="0.5,0.5" Background="Transparent" FontFamily="Segoe MDL2 Assets" Click="OnClick">
                        <Button.RenderTransform>
                            <ScaleTransform ScaleY="1" ScaleX="-1"/>
                        </Button.RenderTransform>
                    </Button>
                    <Button x:Name="Close" Grid.Column="1" Visibility="Collapsed" HorizontalAlignment="Right" Margin="5" Width="30" Content="&#xEF2C;" FontSize="20" Background="Transparent" FontFamily="Segoe MDL2 Assets" Click="OnClick"/>
                </Grid>
                <c1:C1Maps x:Name="Map" Grid.Row="1" Zoom="2" Center="-100,30" />
            </Grid>
        </Border>
        <Border Grid.Row="2" Grid.Column="1" Margin="5,5,0,5" Style="{DynamicResource TileBorder}">
            <flexChart:C1FlexChart x:Name="FunelChart" Style="{DynamicResource TilePanelTitleChart}" BindingX="Level" LegendPosition="Bottom" ChartType="Funnel" Header="{x:Static res:Resource.Opportunities_Header}">
                <flexChart:Series Binding="Sales" />
                <flexChart:C1FlexChart.DataLabel>
                    <flexChart:DataLabel Content="{}{y:C0}" Position="Center" />
                </flexChart:C1FlexChart.DataLabel>
                <flexChart:C1FlexChart.Options>
                    <flexChart:ChartOptions FunnelType="Default" FunnelNeckHeight="0.24" />
                </flexChart:C1FlexChart.Options>
            </flexChart:C1FlexChart>
        </Border>
        <Border Grid.Row="3" Grid.ColumnSpan="2" Margin="0,5,0,0" Style="{DynamicResource TileBorder}">
            <local:RangeSelector DateRangeChanged="OnDateRangeChanged" />
        </Border>
    </Grid>
</Page>
