|
|
|
|
<Window x:Class="LiveChartPractice.MainWindow"
|
|
|
|
|
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:local="clr-namespace:LiveChartPractice"
|
|
|
|
|
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
Title="MainWindow" Height="450" Width="800">
|
|
|
|
|
<Window.DataContext>
|
|
|
|
|
<local:SampleData/>
|
|
|
|
|
</Window.DataContext>
|
|
|
|
|
<Grid Margin="10">
|
|
|
|
|
<TabControl>
|
|
|
|
|
<TabItem Header="Lines">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
<RowDefinition Height="20"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<lvc:CartesianChart Grid.Row="0" Series="{Binding SeriesCollection}" LegendLocation="Right" Zoom="Xy">
|
|
|
|
|
<lvc:CartesianChart.AxisY>
|
|
|
|
|
<lvc:Axis Title="Sales" LabelFormatter="{Binding YFormatter}"/>
|
|
|
|
|
</lvc:CartesianChart.AxisY>
|
|
|
|
|
<lvc:CartesianChart.AxisX>
|
|
|
|
|
<lvc:Axis Title="Month" Labels="{Binding Labels}"/>
|
|
|
|
|
</lvc:CartesianChart.AxisX>
|
|
|
|
|
</lvc:CartesianChart>
|
|
|
|
|
<Button x:Name="btnSeriesAdd" Grid.Row="1" Content="Add" Click="btnSeriesAdd_Click"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</TabItem>
|
|
|
|
|
|
|
|
|
|
<TabItem Header="RT">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
<RowDefinition Height="20"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<lvc:CartesianChart Grid.Row="0" DisableAnimations="True" Series="{Binding SingleSeries}"/>
|
|
|
|
|
<Button x:Name="btnRT" Grid.Row="1" Content="Add" Click="btnRT_Click"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</TabItem>
|
|
|
|
|
|
|
|
|
|
<TabItem Header="Material Design">
|
|
|
|
|
|
|
|
|
|
</TabItem>
|
|
|
|
|
</TabControl>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Window>
|