<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BoxOfficeDashboard.Views"
    xmlns:c="using:BoxOfficeDashboard.Converters"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Chart="using:C1.Xaml.Chart"
    x:Class="BoxOfficeDashboard.Views.TotalChart"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <Grid>
        
        <TextBlock Text="Total Gross" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{StaticResource TitleTextBlockStyle}"/>
        <Chart:C1Chart x:Name="c1Chart1" ChartType="Column" Palette="Aspect">
            <Chart:C1Chart.Resources>
                <c:DoubleFormatter x:Key="df" />
                <DataTemplate x:Key="GrossLabel">
                    <TextBlock Text="{Binding Value, Converter={StaticResource df}, ConverterParameter=c2}" />
                </DataTemplate>
                <DataTemplate x:Key="MoviesLabel">
                    <TextBlock Text="{Binding Value}" />
                </DataTemplate>
            </Chart:C1Chart.Resources>
            <Chart:C1Chart.Data>
                <Chart:ChartData ItemsSource="{Binding}" ItemNameBinding="{Binding Name}">
                    <Chart:ChartData.Children>
                        <Chart:DataSeries Label="Total Gross" Opacity="1" ValueBinding="{Binding Gross}" PointTooltipTemplate="{StaticResource GrossLabel}" SymbolStroke="Transparent"/>
                        <Chart:DataSeries Label="Total Movies" Opacity="1" ValueBinding="{Binding TotalMovies}" AxisY="TotalMovies" PointTooltipTemplate="{StaticResource MoviesLabel}" SymbolStroke="Transparent"/>
                        <Chart:DataSeries Label="Gross Per Movie" Opacity="1" ValueBinding="{Binding GrossPerMovie}" PointTooltipTemplate="{StaticResource GrossLabel}" SymbolStroke="Transparent" Display="SkipNaN"/>
                    </Chart:ChartData.Children>
                </Chart:ChartData>
            </Chart:C1Chart.Data>
            <Chart:C1Chart.View>
                <Chart:ChartView>
                    <Chart:ChartView.AxisX>
                        <Chart:Axis AnnoAngle="45" MinorTickThickness="0" MajorGridStrokeThickness="0"/>
                    </Chart:ChartView.AxisX>
                    <Chart:ChartView.AxisY>
                        <Chart:Axis Title="Gross (millions)" Min="0" MinorTickThickness="0" MajorTickThickness="0" MajorGridFill="#4C686868">
                            <Chart:Axis.AxisLine>
                                <Line StrokeThickness="0.5" />
                            </Chart:Axis.AxisLine>
                        </Chart:Axis>
                    </Chart:ChartView.AxisY>
                    <Chart:ChartView.Axes>
                        <Chart:Axis AxisType="Y" Name="TotalMovies" Position="Far" Min="0" Title="Total Movies" MinorTickThickness="0" MajorTickHeight="10" MajorTickOverlap="1" MajorTickThickness="0.5">
                            <Chart:Axis.AxisLine>
                                <Line StrokeThickness="0.5" />
                            </Chart:Axis.AxisLine>
                        </Chart:Axis>
                    </Chart:ChartView.Axes>
                </Chart:ChartView>
            </Chart:C1Chart.View>
            <Chart:C1ChartLegend Position="TopLeft" Orientation="Horizontal" VerticalContentAlignment="Center" Margin="5 20"/>
        </Chart:C1Chart>

    </Grid>
</UserControl>
