[英]MicroCharts on Xamarin.Forms iOS outside of ViewPort
I got the issue, that the labels and values around a RadarChart (as well es DonutChart, PieChart,...) are outside the viewport.我遇到了问题,RadarChart(以及es DonutChart,PieChart,......)周围的标签和值在视口之外。 Is there any way to fix it?有什么办法可以解决吗?
My XAML looks like:我的 XAML 看起来像:
<microcharts:ChartView Grid.Row="1" Chart="{Binding ChartEmployer}" IsVisible="{Binding EmployersChartVisibility}" x:Name="EmployerChart" />
and my ViewModel returns我的 ViewModel 返回
return new RadarChart()
{
Entries = EntriesEmployer,
LabelTextSize = 50f,
BorderLineColor = Application.Current.RequestedTheme == OSAppTheme.Light ? SKColors.Black : SKColors.White,
BackgroundColor = SKColors.Transparent,
LabelColor = Application.Current.RequestedTheme == OSAppTheme.Light
? SKColors.Black
: SKColors.White,
BorderLineSize = 4,
PointSize = 20,
LineSize = 8,
};
Thanks in advance提前致谢
You can set a height for the microcharts in xaml.您可以在 xaml 中设置微图的高度。 Here is the code:这是代码:
<forms:ChartView x:Name="Chart1" HeightRequest="300"/>
In the viewmodel, you can set the LabelTextSize in a small size.在视图模型中,您可以将 LabelTextSize 设置为小尺寸。 Here is the code:这是代码:
Chart1.Chart = new RadarChart() {
Entries = entries,
LabelTextSize = 10,
BackgroundColor = SKColors.Transparent,
LabelColor = Application.Current.RequestedTheme == OSAppTheme.Light
? SKColors.Black
: SKColors.White,
LineSize = 15,
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.