<UserControl
    x:Class="FlexChart101.Dynamic"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:FlexChart101"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Chart="http://schemas.componentone.com/winfx/2006/xaml"
    DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
    mc:Ignorable="d">

    <Grid>
        <Grid.Resources>
            <Style TargetType="Button">
                <Setter Property="Width" Value="100" />
                <Setter Property="Height" Value="30" />
                <Setter Property="Margin" Value="0 8 30 0" />
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="10">
            <Button x:Name="btnSlow" Content="Slow" Click="btnSlow_Click" />
            <Button x:Name="btnMedium" Content="Medium" Click="btnMedium_Click" />
            <Button x:Name="btnFast" Content="Fast" Click="btnFast_Click" />
            <Button x:Name="btnStop" Content="Stop" Click="btnStart_Click" />
        </StackPanel>
        <Chart:C1FlexChart x:Name="flexChart" BindingX="Day" ChartType="Area" Stacking="Stacked" ItemsSource="{Binding DataContext.Data}" Grid.Row="1">
            <Chart:Series SeriesName="Trucks" Binding="Trucks" />
            <Chart:Series SeriesName="Ships" Binding="Ships" />
            <Chart:Series SeriesName="Planes" Binding="Planes" />
        </Chart:C1FlexChart>
    </Grid>
</UserControl>
