forked from imaNNeo/fl_chart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RadarChart draw functionality added to radar_chart_painter.dart
- Loading branch information
1 parent
a588c30
commit 0aa7e58
Showing
6 changed files
with
251 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import 'package:example/radar_chart/samples/radar_chart_sample1.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class RadarChartPage extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
color: Colors.grey, | ||
padding: const EdgeInsets.all(28.0), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
const Text( | ||
'RadarChart', | ||
style: TextStyle( | ||
color: Color(0xff333333), | ||
fontSize: 32, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
RadarChartSample(), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import 'package:fl_chart/fl_chart.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class RadarChartSample extends StatefulWidget { | ||
@override | ||
_RadarChartSampleState createState() => _RadarChartSampleState(); | ||
} | ||
|
||
class _RadarChartSampleState extends State<RadarChartSample> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return AspectRatio( | ||
aspectRatio: 1.3, | ||
child: Card( | ||
color: Colors.white, | ||
child: RadarChart( | ||
RadarChartData( | ||
titleCount: 3, | ||
fillColor: Colors.grey, | ||
dataSets: showingDataSets(), | ||
tickCount: 4, | ||
getTitle: (index) => '$index + values', | ||
), | ||
), | ||
), | ||
); | ||
} | ||
|
||
List<RadarDataSet> showingDataSets() { | ||
return [ | ||
RadarDataSet( | ||
dataEntries: [ | ||
RadarEntry(value: 5), | ||
RadarEntry(value: 1), | ||
RadarEntry(value: 25), | ||
], | ||
strokeWidth: 3, | ||
color: Colors.red, | ||
), | ||
RadarDataSet( | ||
dataEntries: [ | ||
RadarEntry(value: 18), | ||
RadarEntry(value: 20), | ||
RadarEntry(value: 30), | ||
], | ||
strokeWidth: 3, | ||
color: Colors.orange, | ||
), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters