Xamarin形式:从饼图中删除或隐藏LinearAxis

时间:2019-01-02 13:09:34

标签: c# charts oxyplot

如何删除oxyplot线性Axis线(如图中的黑色边框线)。

我尝试使用以下代码隐藏轴线的可见性,但这些线仍然可见

代码:

modelP2.Series.Add(seriesP2);
        modelP2.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, IsAxisVisible = false, AxislineStyle = LineStyle.None, MinorTicklineColor=OxyColors.Transparent, ExtraGridlineColor =OxyColors.Transparent, MajorGridlineColor=OxyColors.Transparent, MinorGridlineColor =OxyColors.Transparent,TicklineColor=OxyColors.Transparent, AxislineColor =OxyColors.Transparent, TickStyle = TickStyle.None,MinorTickSize = 0, MajorTickSize=0 });
        modelP2.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, IsAxisVisible = false, AxislineStyle = LineStyle.None, MinorTicklineColor = OxyColors.Transparent, ExtraGridlineColor = OxyColors.Transparent , MajorGridlineColor = OxyColors.Transparent, MinorGridlineColor = OxyColors.Transparent, TicklineColor = OxyColors.Transparent, AxislineColor = OxyColors.Transparent, TickStyle = TickStyle.None });
       // modelP2.DefaultXAxis.AxislineColor = OxyColors.White;
        var ta = new TextAnnotation();
        ta.Text = "Label Text";
        ta.TextColor = OxyColors.Black;
        ta.Stroke = OxyColors.Transparent;
        ta.StrokeThickness = 5;
        ta.FontSize = 36;
        ta.TextPosition = new DataPoint(50, 50);
        modelP2.Annotations.Add(ta);

enter image description here

感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

希望我能正确理解您的问题。恕我直言,不是产生黑线的轴,而是绘制区域边界。您应该可以删除它,将颜色更改为透明

D