Skip to content

Commit

Permalink
Merge pull request imaNNeo#597 from payam-zahedi/radar-documentation
Browse files Browse the repository at this point in the history
Radar Chart  documented
  • Loading branch information
imaNNeo authored Mar 10, 2021
2 parents 3d18dd0 + 424465e commit 64562c0
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
|ScatterChart |RadarChart| Coming Soon|
|:------------:|:------------:|:-------------:|
| [![](https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/scatter_chart/scatter_chart_sample_1.gif)](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/scatter_chart.md#sample-1-source-code) [![](https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/scatter_chart/scatter_chart_sample_2.gif)](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/scatter_chart.md#sample-2-source-code) | ![](https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/radar_chart/radar_chart_sample_1.jpg) ![](https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/blank.jpg)|![](https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/blank.jpg) ![](https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/blank.jpg)|
|[Read More](repo_files/documentations/scatter_chart.md)|Read More Coming Soon!||
|[Read More](repo_files/documentations/scatter_chart.md)|[Read More](repo_files/documentations/radar_chart.md)||

Banner designed by [Soheil Saffar](https://www.linkedin.com/in/soheilsaffar), and
samples inspired from
Expand Down
4 changes: 2 additions & 2 deletions lib/src/chart/radar_chart/radar_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RadarChartData extends BaseChartData with EquatableMixin {
/// [radarBorderData] is used to draw [RadarChart] border
final BorderSide radarBorderData;

/// [getTitle] is used to draw titles near the [RadarChart]
/// [getTitle] is used to draw titles outside the [RadarChart]
/// [getTitle] is type of [GetTitleByIndexFunction] so you should return a valid [String]
/// for each [index]
///
Expand All @@ -47,7 +47,7 @@ class RadarChartData extends BaseChartData with EquatableMixin {
final TextStyle titleTextStyle;

/// the [titlePositionPercentageOffset] is the place of showing title on the [RadarChart]
/// the degree is statically on the end of Radar Line,
/// The higher the value of this field, the more titles move away from the chart.
/// this field should be between 0 and 1,
/// if it is 0 the title will be drawn near the inside section,
/// if it is 1 the title will be drawn near the outside of section,
Expand Down
3 changes: 3 additions & 0 deletions repo_files/documentations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ click and learn more about them.

- [PieChart](pie_chart.md)


- [RadarChart](radar_chart.md)

-----------

- [Handle Touches](handle_touches.md)
Expand Down
66 changes: 66 additions & 0 deletions repo_files/documentations/radar_chart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# RadarChart
<img src="https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/radar_chart/radar_chart_sample_1.jpg" width="300" >

### How to use
```dart
RadarChart(
RadarChartData(
// read about it in the below section
),
);
```

### RadarChartData
|PropName |Description |default value|
|:---------------|:---------------|:-------|
|dataSets| list of [RadarDataSet ](#RadarDataSet) that is shown on the radar chart|[]|
|radarBackgroundColor| This property fills the background of the radar with the specified color.| Colors.transparent|
|radarBorderData| shows a border for radar chart|BorderSide(color: Colors.black, width: 2)|
|getTitle| This function helps the radar chart to draw titles outside the chart.|null|
|titleTextStyle|TextStyle of the titles|TextStyle(color: Colors.black, fontSize: 12)|
|titlePositionPercentageOffset|this field is the place of showing title on the RadarChart. The higher the value of this field, the more titles move away from the chart. this field should be between 0 and 1.|0.2|
|tickCount|Defines the number of ticks that should be paint in RadarChart|1|
|ticksTextStyle|TextStyle of the tick titles|TextStyle(fontSize: 10, color: Colors.black)|
|tickBorderData|Style of the tick borders|BorderSide(color: Colors.black, width: 2)|
|gridBorderData|Style of the grid borders|BorderSide(color: Colors.black, width: 2)|
|radarTouchData|Handles touch behaviors and responses.|RadarTouchData()|

### RadarDataSet
|PropName |Description |default value|
|:---------------|:---------------|:-------|
|dataEntries|Each RadarDataSet contains list of [RadarEntries ](#RadarEntry) that is shown in RadarChart.|[]|
|fillColor|fills the DataSet with the specified color.|Colors.black12|
|borderColor|Paint the DataSet border with the specified color.|Colors.blueAccent|
|borderWidth|defines the width of [RadarDataSet](#RadarDataSet) border.|2.0|
|entryRadius|defines the radius of each [RadarEntries ](#RadarEntry).|5.0|

### RadarEntry
|PropName |Description |default value|
|:---------------|:---------------|:-------|
|value| RadarChart uses this field to render every point in chart.| null |

### RadarTouchData ([read about touch handling](handle_touches.md))
|PropName|Description|default value|
|:-------|:----------|:------------|
|enabled|determines to enable or disable touch behaviors|true|
|touchCallback| listen to this callback to retrieve touch events, it gives you a [RadarTouchResponse](#RadarTouchResponse)| null|
|touchSpotThreshold|the threshold of the touch accuracy. we find the nearest spots on touched position based on this field.|10|


### RadarTouchResponse
|PropName|Description|default value|
|:-------|:----------|:------------|
|touchedSpot|the [RadarTouchedSpot](#RadarTouchedSpot) that user touched| null |

### RadarTouchedSpot
|PropName|Description|default value|
|:-------|:----------|:------------|
|touchedDataSet|the [RadarDataSet](#RadarDataSet) that user touched| null |
|touchedDataSetIndex| index of the [RadarDataSet](#RadarDataSet) that user touched| null |
|touchedRadarEntry|the [RadarEntry](#RadarEntry) that user touched| null |
|touchedRadarEntryIndex| index of the [RadarEntry](#RadarEntry) that user touched| null |

### some samples
----
##### Sample 1 ([Source Code](example/lib/radar_chart/samples/radar_chart_sample1.dart))
<img src="https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/radar_chart/radar_chart_sample_1.jpg" width="300" >

0 comments on commit 64562c0

Please sign in to comment.