<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="ChartSamples.Labels" mc:Ignorable="d" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:c1chart="clr-namespace:C1.WPF.C1Chart;assembly=C1.WPF.C1Chart.4" 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">
    <UserControl.Resources>
    	<Style TargetType="c1chart:C1Chart">
			<Setter Property="Foreground" Value="#666666" />
			<Setter Property="CustomPalette">
				<Setter.Value>
					<ResourceDictionary>
						<SolidColorBrush x:Key="0" Color="#16ABA9" />
						<SolidColorBrush x:Key="1" Color="#EB7A2A" />
						<SolidColorBrush x:Key="2" Color="#F2CA04" />
						<SolidColorBrush x:Key="3" Color="#DC5B20" />
						<SolidColorBrush x:Key="4" Color="#8EBC00" />
						<SolidColorBrush x:Key="5" Color="#25A0DA" />
						<SolidColorBrush x:Key="6" Color="#25A0DA" />
						<SolidColorBrush x:Key="7" Color="#309B46" />
						<SolidColorBrush x:Key="8" Color="#24C6D2" />
						<SolidColorBrush x:Key="9" Color="#8A8065" />
					</ResourceDictionary>
				</Setter.Value>
			</Setter>	       	
        </Style>
        <c1chart:DataPointConverter x:Key="fc" />
        <DataTemplate x:Key="lbl">
        	<Grid>
        		<Path Data="M0.5,0.5 L23,0.5 23,23 11.61165,29.286408 0.5,23 z" Stretch="Fill" Fill="#FFF1F1F1" Stroke="DarkGray" StrokeThickness="1" />
        		<TextBlock FontSize="10" Margin="5 5 5 15" Foreground="DarkRed" Text="{Binding ConverterParameter=Series: \{#SeriesLabel\}\{#NewLine\}Point: \{#PointIndex\}\{#NewLine\}Value: \{#Value\}, Converter={StaticResource fc}}" />
			</Grid>
        </DataTemplate>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border Grid.Row="0" VerticalAlignment="Center">
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 0 10">

                <StackPanel Orientation="Horizontal">
                    <TextBlock VerticalAlignment="Center" Margin="0 0 4 0" Text="View" />
                    <RadioButton VerticalAlignment="Center" x:Name="rbLabels" IsChecked="true" Checked="rbLabel_Checked" Margin="4 0" />
                    <TextBlock VerticalAlignment="Center" Text="Label" Margin="0 0 4 0" />
                    <RadioButton VerticalAlignment="Center" x:Name="rbTooltips" Checked="rbLabel_Checked" Margin="4 0" />
                    <TextBlock VerticalAlignment="Center" Text="Tooltips" Margin="0 0 4 0" />
                </StackPanel>

                <TextBlock VerticalAlignment="Center" Text="ChartType:" Margin="15 0 4 0" />
                <ComboBox Width="140" x:Name="cbChartType" SelectionChanged="cbChartType_SelectionChanged" Margin="4,0,0,0" Height="22" />
            </StackPanel>
        </Border>

        <c1chart:C1Chart Grid.Row="1" x:Name="c1chart" ChartType="Column">
            <c1chart:C1Chart.Data>
                <c1chart:ChartData>
                    <c1chart:DataSeries Label="s1" Values="3 5 7 4" PointLabelTemplate="{StaticResource lbl}" PlotElementLoaded="DataSeries_PlotElementLoaded" />
                    <c1chart:DataSeries Label="s2" Values="1 2 3 8" PointLabelTemplate="{StaticResource lbl}" PlotElementLoaded="DataSeries_PlotElementLoaded" />
                </c1chart:ChartData>
            </c1chart:C1Chart.Data>
            <c1chart:C1ChartLegend x:Name="legend" />
        </c1chart:C1Chart>
    </Grid>
</UserControl>