mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-07 18:20:51 +08:00
40 lines
2.0 KiB
Plaintext
40 lines
2.0 KiB
Plaintext
|
|
<UserControl x:Class="Wpf.CartesianChart.Linq.LinqExample"
|
||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
|
|
xmlns:local="clr-namespace:Wpf.CartesianChart.Linq"
|
||
|
|
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
||
|
|
mc:Ignorable="d"
|
||
|
|
d:DesignHeight="300" d:DesignWidth="300"
|
||
|
|
d:DataContext="{d:DesignInstance local:LinqExample}">
|
||
|
|
<Grid>
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"></RowDefinition>
|
||
|
|
<RowDefinition Height="*"></RowDefinition>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||
|
|
<TextBlock VerticalAlignment="Center" Margin="10 0">Search</TextBlock>
|
||
|
|
<TextBox Name="Query" VerticalContentAlignment="Center" Width="100" Height="30"
|
||
|
|
TextChanged="TextBoxBase_OnTextChanged"></TextBox>
|
||
|
|
</StackPanel>
|
||
|
|
<lvc:CartesianChart Grid.Row="1" >
|
||
|
|
<lvc:CartesianChart.Series>
|
||
|
|
<lvc:ColumnSeries Title="2016 Population by City"
|
||
|
|
Values="{Binding Results}"
|
||
|
|
Configuration="{Binding Mapper}"/>
|
||
|
|
</lvc:CartesianChart.Series>
|
||
|
|
<lvc:CartesianChart.AxisX>
|
||
|
|
<lvc:Axis LabelsRotation="-20" Labels="{Binding Labels}" DisableAnimations="True">
|
||
|
|
<lvc:Axis.Separator>
|
||
|
|
<lvc:Separator Step="1"></lvc:Separator>
|
||
|
|
</lvc:Axis.Separator>
|
||
|
|
</lvc:Axis>
|
||
|
|
</lvc:CartesianChart.AxisX>
|
||
|
|
<lvc:CartesianChart.AxisY>
|
||
|
|
<lvc:Axis LabelFormatter="{Binding MillionFormatter}"></lvc:Axis>
|
||
|
|
</lvc:CartesianChart.AxisY>
|
||
|
|
</lvc:CartesianChart>
|
||
|
|
</Grid>
|
||
|
|
</UserControl>
|