mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-22 09:26:35 +08:00
项目结构调整
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Windows.Controls;
|
||||
using LiveCharts;
|
||||
using LiveCharts.Wpf;
|
||||
|
||||
namespace Wpf.PieChart
|
||||
{
|
||||
public partial class PieChartExample : UserControl
|
||||
{
|
||||
public PieChartExample()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
PointLabel = chartPoint =>
|
||||
string.Format("{0} ({1:P})", chartPoint.Y, chartPoint.Participation);
|
||||
|
||||
DataContext = this;
|
||||
}
|
||||
|
||||
public Func<ChartPoint, string> PointLabel { get; set; }
|
||||
|
||||
private void Chart_OnDataClick(object sender, ChartPoint chartpoint)
|
||||
{
|
||||
var chart = (LiveCharts.Wpf.PieChart) chartpoint.ChartView;
|
||||
|
||||
//clear selected slice.
|
||||
foreach (PieSeries series in chart.Series)
|
||||
series.PushOut = 0;
|
||||
|
||||
var selectedSeries = (PieSeries) chartpoint.SeriesView;
|
||||
selectedSeries.PushOut = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user