Jay*_*sta 0 xamarin.android xamarin xamarin-studio xamarin.forms
我尝试在 Xamarin.Forms 中创建图表,但无法显示。我也想知道我要把这段代码放在哪里。它是在 .xaml 中还是在 .xaml.cs 中?我只是使用 Xamarin 的初学者,所以也许有人可以帮助我。
这是我要使用的代码。
using BarChart;
...
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
var data = new [] { 1f, 2f, 4f, 8f, 16f, 32f };
var chart = new BarChartView (this) {
ItemsSource = Array.ConvertAll (data, v => new BarModel { Value = v })
};
AddContentView (chart, new ViewGroup.LayoutParams (
ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));
}
Run Code Online (Sandbox Code Playgroud)
Xamarin.Forms 实际上没有任何图表控件。Syncfusion为 Xamarin.Forms提供出色的图表控件,并附带免费提供的社区许可证。
这是 Xamarin 使用 SyncFusion Chart Controls 的完整示例
| 归档时间: |
|
| 查看次数: |
2616 次 |
| 最近记录: |