【发布时间】:2019-09-02 13:28:21
【问题描述】:
我想在 Flutter 应用中显示雷达图。 我找到了这个库: this 但我不知道如何使用颤振应用程序进行这项工作,也没有找到任何明确的例子。 我也对图书馆的其他用途持开放态度,以便在我的应用程序上使用雷达图。 我已经绑定了这个:
import 'package:flutter/material.dart';
import 'package:modern_charts/modern_charts.dart' as cart;
void main() {
runApp(new MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
static var table = cart.DataTable(
[
['Categories', 'Series 1'],
['Monday', 1],
['Tuesday', 3],
['Wednesday', 4],
['Thursday', null],
['Friday', 3],
['Saturday', 5],
['Sunday', 4]]);
// Define user options.
static var options = {
'series': {
'labels': {
'enabled': true
}
}
};
static Center centre = Center();
// Create and render the chart.
var chart = cart.RadarChart(centre)
..draw(table, options);
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('Plugin example app'),
),
body: centre,
),
);
}
}
提前致谢。
【问题讨论】: