Charts 如何在xamarin.android中使用oxyplot创建圆环图?
我需要创建一个应用程序,显示图表像海图。但我没有为此得到任何图书馆。所以我用oxyplot来创建图表。我已经用oxyplot创建了饼图,就像这样Charts 如何在xamarin.android中使用oxyplot创建圆环图?,charts,highcharts,xamarin.android,oxyplot,Charts,Highcharts,Xamarin.android,Oxyplot,我需要创建一个应用程序,显示图表像海图。但我没有为此得到任何图书馆。所以我用oxyplot来创建图表。我已经用oxyplot创建了饼图,就像这样 var plotView = new PlotView (this); plotView.Model = PieViewModel(); this.AddContentView (plotView, new ViewGroup.LayoutParams (ViewGroup.LayoutPara
var plotView = new PlotView (this);
plotView.Model = PieViewModel();
this.AddContentView (plotView,
new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));
public PlotModel PieViewModel()
{
var modelP1 = new PlotModel { Title = "Pie Sample1" };
dynamic seriesP1 = new PieSeries { StrokeThickness = 2.0, InsideLabelPosition = 0.8, AngleSpan = 360, StartAngle = 0 };
seriesP1.Slices.Add(new PieSlice("Africa", 1030) { IsExploded = false, Fill = OxyColors.PaleVioletRed });
seriesP1.Slices.Add(new PieSlice("Americas", 929) { IsExploded = true });
seriesP1.Slices.Add(new PieSlice("Asia", 4157) { IsExploded = true });
seriesP1.Slices.Add(new PieSlice("Europe", 739) { IsExploded = true });
seriesP1.Slices.Add(new PieSlice("Oceania", 35) { IsExploded = true });
modelP1.Series.Add(seriesP1);
return modelP1;
}
但现在我需要创建带有点击监听器和点击效果的甜甜圈图表。
我该怎么做
提前谢谢你@Nisar Ahmad
使用圆环图的oxyplot库查找以下代码
public static PlotModel Simplemodel()
{
var modelP1 = new PlotModel { Title = "Pie Sample1" };
dynamic seriesP1 = new PieSeries { StrokeThickness = 2.0, InsideLabelPosition = 0.5, AngleSpan = 360, StartAngle = 0, InnerDiameter = 0.4 };
seriesP1.Slices.Add(new PieSlice("Africa", 1030) { IsExploded = false, Fill = OxyColors.PaleVioletRed });
seriesP1.Slices.Add(new PieSlice("Americas", 929) { IsExploded = true });
seriesP1.Slices.Add(new PieSlice("Asia", 4157) { IsExploded = true });
seriesP1.Slices.Add(new PieSlice("Europe", 739) { IsExploded = true });
seriesP1.Slices.Add(new PieSlice("Oceania", 35) { IsExploded = true });
modelP1.Series.Add(seriesP1);
return modelP1;
}