<Page
    x:Class="FlexChartExplorer.Histogram"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Chart="using:C1.Xaml.Chart"
    xmlns:local="using:FlexChartExplorer"
    DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
    x:Name="page"
    mc:Ignorable="d">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel x:Name="stackPanel" Orientation="Horizontal">
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                <TextBlock Margin="10" Text="BinWidth : " VerticalAlignment="Center"/>
                <TextBox Margin="10" x:Name="tbBinWidth" Width="100" VerticalAlignment="Center" TextAlignment="Right" TextChanged="TextBox_TextChanged"/>
            </StackPanel>
        </StackPanel>
        <Chart:C1FlexChart x:Name="flexChart" ChartType="Histogram" ItemsSource="{Binding DataContext.Data}" Grid.Row="1" Binding="Y" BindingX="X" Rendered="flexChart_Rendered">
            <Chart:C1FlexChart.AxisX>
                <Chart:Axis Format="0.00"></Chart:Axis>
            </Chart:C1FlexChart.AxisX>
            <Chart:Histogram x:Name="histogramSeries" SeriesName="Frequency"/>
            <Chart:Series ChartType="Scatter" SeriesName="Value"/>
        </Chart:C1FlexChart>
    </Grid>
</Page>
