C# 形式:OxyPlot饼图内的可移动标签
你好。我正在创建一个Xamarin.Forms便携式应用程序,在那里我可以使用OxyPlot显示图表 我的问题是: 1。)每当我试图将标签放在图表附近的某个位置时,无论何时我在屏幕上滑动,标签似乎都是可移动的 2。)我无法删除图表周围的黑色边框 你认为这背后的原因是什么?非常感谢 这是我的密码:C# 形式:OxyPlot饼图内的可移动标签,c#,asp.net,xaml,xamarin,xamarin.forms,C#,Asp.net,Xaml,Xamarin,Xamarin.forms,你好。我正在创建一个Xamarin.Forms便携式应用程序,在那里我可以使用OxyPlot显示图表 我的问题是: 1。)每当我试图将标签放在图表附近的某个位置时,无论何时我在屏幕上滑动,标签似乎都是可移动的 2。)我无法删除图表周围的黑色边框 你认为这背后的原因是什么?非常感谢 这是我的密码: using OxyPlot; using OxyPlot.Annotations; using OxyPlot.Axes; using OxyPlot.Series; using System; us
using OxyPlot;
using OxyPlot.Annotations;
using OxyPlot.Axes;
using OxyPlot.Series;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace XamarinFormsDemo.ViewModels
{
public class SalesPerProductViewModel : INotifyPropertyChanged
{
private PlotModel modelP1;
SalesVM salesVM = new SalesVM();
public SalesPerProductViewModel()
{
// PieViewModel vm = new PieViewModel();
modelP1 = new PlotModel
{
Title = "Sales Per Product",
TitleColor = OxyColors.Teal,
TitleFontSize = 30,
TextColor = OxyColors.White,
DefaultFont = "Arial Black",
DefaultFontSize = 20
};
TextAnnotation annotation = new TextAnnotation();
annotation.Text = "Total Sales Label: ";
annotation.TextColor = OxyColors.White;
annotation.Stroke = OxyColors.Transparent;
annotation.StrokeThickness = 5;
annotation.FontSize = 20;
annotation.TextPosition = new DataPoint(30, 90);
modelP1.Annotations.Add(annotation);
modelP1.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, IsAxisVisible = false });
modelP1.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, IsAxisVisible = false });
// modelP1.Annotations.Add(annotation);
dynamic seriesP1 = new PieSeries { StrokeThickness = 2.0, InsideLabelPosition = 0.8, AngleSpan = 360, StartAngle = 0 };
// seriesP1.Add(salesVM.SalesModelvm);
seriesP1.Slices.Add(new PieSlice("Keyboard", 5900) { IsExploded = false, Fill = OxyColors.Teal });
seriesP1.Slices.Add(new PieSlice("Monitor", 4430) { IsExploded = true });
seriesP1.Slices.Add(new PieSlice("Flash Drive", 11620) { IsExploded = true });
seriesP1.Slices.Add(new PieSlice("Hard Drive", 7000) { IsExploded = true });
seriesP1.Slices.Add(new PieSlice("RAM", 8000) { IsExploded = true });
modelP1.Series.Add(seriesP1);
this.SalesPerProductModel = modelP1;
}
public PlotModel SalesPerProductModel { get; private set; }
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}