Skip to content

Commit

Permalink
sample RadarChartData added to data_pool.dart file
Browse files Browse the repository at this point in the history
  • Loading branch information
payam-zahedi committed Feb 23, 2021
1 parent 6eb1fba commit cbdf05a
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/chart/radar_chart/radar_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class RadarChartData extends BaseChartData {
int get titleCount => dataSets[0].dataEntries.length;

RadarChartData copyWith({
@required List<RadarDataSet> dataSets,
List<RadarDataSet> dataSets,
Color radarBackgroundColor,
BorderSide radarBorderData,
GetTitleByIndexFunction getTitle,
Expand Down
66 changes: 66 additions & 0 deletions test/chart/data_pool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2815,3 +2815,69 @@ final BarChartData barChartData13 = barChartData1.copyWith(
final BarChartData barChartData14 = barChartData1.copyWith(
groupsSpace: 444,
);

final RadarDataSet radarDataSet1 = RadarDataSet(
dataEntries: [RadarEntry(0), RadarEntry(1), RadarEntry(2), RadarEntry(3), RadarEntry(4)],
borderColor: Colors.blue,
borderWidth: 3,
entryRadius: 3,
fillColor: Colors.grey,
);

final RadarDataSet radarDataSet1Clone = radarDataSet1.copyWith();

final RadarDataSet radarDataSet2 = RadarDataSet(
dataEntries: [RadarEntry(10), RadarEntry(9), RadarEntry(8), RadarEntry(7), RadarEntry(6)],
borderColor: Colors.red,
borderWidth: 5,
entryRadius: 5,
fillColor: Colors.black,
);

final RadarTouchData radarTouchData1 = RadarTouchData(
enabled: true,
touchCallback: radarTouchCallback,
touchSpotThreshold: 12,
);

final RadarTouchData radarTouchData2 = RadarTouchData(
enabled: false,
touchCallback: radarTouchCallback,
touchSpotThreshold: 5,
);

final RadarTouchData radarTouchData1Clone = radarTouchData1;

final Function(RadarTouchResponse) radarTouchCallback = (response) {};

final RadarChartData radarChartData1 = RadarChartData(
dataSets: [radarDataSet1],
radarBackgroundColor: Colors.yellow,
radarBorderData: BorderSide(color: Colors.purple, width: 5),
borderData: borderData1,
gridBorderData: BorderSide(color: Colors.blue, width: 2),
getTitle: (index) => 'testTitle',
titlePositionPercentageOffset: 0.2,
titleTextStyle: TextStyle(color: Colors.white, fontSize: 12),
radarTouchData: radarTouchData1,
tickCount: 5,
tickBorderData: BorderSide(color: Colors.black, width: 4),
ticksTextStyle: TextStyle(color: Colors.white, fontSize: 12),
);

final RadarChartData radarChartData1Clone = radarChartData1.copyWith();

final RadarChartData radarChartData2 = RadarChartData(
dataSets: [radarDataSet2],
radarBackgroundColor: Colors.blue,
radarBorderData: BorderSide(color: Colors.pink, width: 3),
borderData: borderData1,
gridBorderData: BorderSide(color: Colors.red, width: 3),
getTitle: (index) => 'testTitle2',
titlePositionPercentageOffset: 0.5,
titleTextStyle: TextStyle(color: Colors.black, fontSize: 5),
radarTouchData: radarTouchData2,
tickCount: 1,
tickBorderData: BorderSide(color: Colors.pink, width: 2),
ticksTextStyle: TextStyle(color: Colors.purple, fontSize: 10),
);

0 comments on commit cbdf05a

Please sign in to comment.