<UserControl 
    x:Class="ControlExplorer.Controls.Chart.FinancialChart"
    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:c1chart="using:C1.Xaml.Chart" SizeChanged="UserControl_SizeChanged"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
    <c1chart:C1Chart x:Name="chart" Grid.Row="1" c1chart:BarColumnOptions.Size="1" ChartType="Candle" Palette="Oriel" Margin="30 10 35 10">
        <c1chart:C1Chart.Resources>
            <!--<DataTemplate x:Key="tt">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.ColumnSpan="2" Text="{Binding XAsString}" FontStyle="Oblique" FontSize="20" />
                    <TextBlock Grid.Row="1" Text="Low= " FontSize="20"/>
                    <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Low}" Foreground="Blue" FontSize="20"/>
                    <TextBlock Grid.Row="2" Text="High= " FontSize="20"/>
                    <TextBlock Grid.Column="1" Grid.Row="2" Text="{Binding High}" Foreground="Red" FontSize="20"/>
                    <TextBlock Grid.Row="3" Text="Open= " FontSize="20"/>
                    <TextBlock Grid.Column="1" Grid.Row="3" Text="{Binding Open}" FontSize="20"/>
                    <TextBlock Grid.Row="4" Text="Close= " FontSize="20"/>
                    <TextBlock Grid.Column="1" Grid.Row="4" Text="{Binding Close}" FontSize="20"/>
                </Grid>
            </DataTemplate>-->
            <!--<DataTemplate x:Key="ttVol">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.ColumnSpan="2" Text="{Binding XAsString}" FontStyle="Oblique" FontSize="20"/>
                    <TextBlock Grid.Row="1" Text="Volume=" FontSize="20"/>
                    <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Y}" FontSize="20"/>
                </Grid>
            </DataTemplate>-->
        </c1chart:C1Chart.Resources>
        <c1chart:C1Chart.Data>
            <c1chart:ChartData>
                <c1chart:ChartData.Children>
                    <c1chart:XYDataSeries XValueBinding="{Binding Time}" 
                                          ValueBinding="{Binding Volume}"
                                          AxisY="Volume"/>
                    <c1chart:HighLowOpenCloseSeries SymbolSize="15,15" 
                                                    SymbolStrokeThickness="2"
                                                    XValueBinding="{Binding Time}"
                                                    HighValueBinding="{Binding High}"
                                                    LowValueBinding="{Binding Low}"
                                                    OpenValueBinding="{Binding Open}"
                                                    CloseValueBinding="{Binding Close}" />
                </c1chart:ChartData.Children>
            </c1chart:ChartData>
        </c1chart:C1Chart.Data>
        <c1chart:C1Chart.View>
            <c1chart:ChartView>
                <c1chart:ChartView.AxisX>
                    <c1chart:Axis UseExactLimits="True" />
                </c1chart:ChartView.AxisX>
                <c1chart:ChartView.AxisY>
                    <c1chart:Axis AnnoPosition="Far" Min="600" MajorUnit="100" AnnoFormat="c0" MajorTickThickness="0" MinorTickThickness="0" />
                </c1chart:ChartView.AxisY>
                <c1chart:ChartView.Axes>
                    <c1chart:Axis x:Name="Volume" Max="200" Position="Far"  AxisType="Y" MajorTickThickness="0" MinorTickThickness="0"/>
                </c1chart:ChartView.Axes>
                    <!-- Markers layer -->
                    <c1chart:ChartView.Layers>
                        <c1chart:ChartPanel>
                            <c1chart:ChartPanelObject x:Name="vline"
                                                      Attach="DataX"
                                                      Action="MouseMove"
                                                      VerticalContentAlignment="Stretch"
                                                      HorizontalAlignment="Center">
                                <Border Background="Black" Opacity="0.1" Width="36" BorderBrush="Black" BorderThickness="1" Padding="0" />
                            </c1chart:ChartPanelObject>
                            <c1chart:ChartPanelObject x:Name="obj" 
                                                      Attach="DataX"
                                                      Action="MouseMove"
                                                      DataPointChanged="obj_DataPointChanged"
                                                      HorizontalAlignment="Center"
                                                      HorizontalContentAlignment="Center"
                                                      VerticalAlignment="Top"
                                                 Width="60">
                                <c1chart:ChartPanelObject.RenderTransform>
                                    <TranslateTransform Y="-70"/>
                                </c1chart:ChartPanelObject.RenderTransform>
                            </c1chart:ChartPanelObject>

                            
                        </c1chart:ChartPanel>
                    </c1chart:ChartView.Layers>
                </c1chart:ChartView>
        </c1chart:C1Chart.View>
    </c1chart:C1Chart>
        <!--<TextBlock Text="Price" Margin="5 0"/>
        <TextBlock Text="Volume" Margin="5 0" HorizontalAlignment="Right"/>-->
        <Button x:Name="btnScrollLeft" Click="btnScrollLeft_Click" HorizontalAlignment="Left"  VerticalAlignment="Top" Width="50" MinWidth="10" Margin="5 0">
            <TextBlock>
                &lt;
            </TextBlock>
        </Button>
        <Button x:Name="btnScrollRight" Click="btnScrollRight_Click" Content=">" HorizontalAlignment="Right"  VerticalAlignment="Top" Width="50" MinWidth="10" Margin="5 0"/>
    </Grid>
</UserControl>
