mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-07 10:10:49 +08:00
47 lines
2.2 KiB
XML
47 lines
2.2 KiB
XML
<UserControl x:Class="Wpf.PieChart.DoughnutChartExample"
|
|
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.PieChart"
|
|
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance local:DoughnutChartExample}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"></RowDefinition>
|
|
<RowDefinition Height="*"></RowDefinition>
|
|
</Grid.RowDefinitions>
|
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
|
<Button Click="UpdateAllOnClick" Padding="10 0">
|
|
Move All
|
|
</Button>
|
|
<Button Click="RestartOnClick">Restart</Button>
|
|
<TextBlock VerticalAlignment="Center" Padding="10 0">Series</TextBlock>
|
|
<Button Click="AddSeriesOnClick" MinWidth="30">
|
|
+
|
|
</Button>
|
|
<Button Click="RemoveSeriesOnClick" MinWidth="30">
|
|
-
|
|
</Button>
|
|
<TextBlock VerticalAlignment="Center" Padding="10 0">Values</TextBlock>
|
|
<Button Height="30" Click="AddValueOnClick" MinWidth="30">
|
|
+
|
|
</Button>
|
|
<Button Height="30" Click="RemoveValueOnClick" MinWidth="30">
|
|
-
|
|
</Button>
|
|
|
|
</StackPanel>
|
|
<lvc:PieChart Name="Chart" Grid.Row="1" Series="{Binding SeriesCollection}"
|
|
LegendLocation="Right" InnerRadius="100" Margin="0 15">
|
|
<lvc:PieChart.ChartLegend>
|
|
<lvc:DefaultLegend BulletSize="20"></lvc:DefaultLegend>
|
|
</lvc:PieChart.ChartLegend>
|
|
<lvc:PieChart.DataTooltip>
|
|
<lvc:DefaultTooltip BulletSize="20"></lvc:DefaultTooltip>
|
|
</lvc:PieChart.DataTooltip>
|
|
</lvc:PieChart>
|
|
</Grid>
|
|
</UserControl>
|