0.0.26 • Published 9 months ago

@salmonco/react-native-radar-chart v0.0.26

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

react-native-radar-chart

You can draw radar charts easily.

Screenshot

Installation

npm install @salmonco/react-native-radar-chart react-native-svg

Usage

import React from 'react';
import {StyleSheet, SafeAreaView} from 'react-native';
import {RadarChart} from '@salmonco/react-native-radar-chart';

const App = () => {
  const data = [
    {label: 'data1', value: 30},
    {label: 'data2', value: 55},
    {label: 'data3', value: 70},
    {label: 'data4', value: 35},
    {label: 'data5', value: 10},
    {label: 'data6', value: 60},
    {label: 'data7', value: 38},
    {label: 'data8', value: 65},
  ];

  return (
    <SafeAreaView style={styles.container}>
      <RadarChart
        data={data}
        maxValue={100}
        gradientColor={{
          startColor: '#FF9432',
          endColor: '#FFF8F1',
          count: 5,
        }}
        stroke={['#FFE8D3', '#FFE8D3', '#FFE8D3', '#FFE8D3', '#ff9532']}
        strokeWidth={[0.5, 0.5, 0.5, 0.5, 1]}
        strokeOpacity={[1, 1, 1, 1, 0.13]}
        labelColor="#433D3A"
        dataFillColor="#FF9432"
        dataFillOpacity={0.8}
        dataStroke="salmon"
        dataStrokeWidth={2}
        isCircle
      />
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default App;

Props

PropDescriptionTypeDefault
dataLabel and value pair data to be displayed on the radar chartRadarData[]required
sizeSize of radar chartnumber330
scaleAdjusts the size of the radar chart. Larger values ​​make the chart larger, while smaller values ​​make the chart smaller.number1
maxValueThe maximum value of data to display on the radar chart. The end point of the chart is reached when the value of the data corresponds to maxValue.numberThe maximum value among the values ​​of data
fillColorColor inside chartstringsalmon
fillOpacityOpacity inside chartnumber1
gradientColorThe gradient color inside the chartGradientColorfillColor ?? salmon
strokeStroke inside chartstring[]white
strokeWidthWidth of stroke inside chartnumber[]0.5
strokeOpacityOpacity of stroke inside chartnumber[]1
labelSizeSize of labels in datanumber16
labelColorColor of labels in datastringblack
labelFontFamilyFont family of labels in datastringInter
labelDistanceAdjusts the position of the label. Larger values ​​move the labels farther away from the edges of the chart, while smaller values ​​move the labels closer to the center of the chart.number1.15
dataFillColorColor of data areastringgreen
dataFillOpacityOpacity of data areanumber1
dataStrokeStroke of data areastringundefined
dataStrokeWidthWidth of stroke of data areanumber1
dataStrokeOpacityOpacity of stroke of data areanumber1
divisionStrokeStroke of division line that divides each data axisstringwhite
divisionStrokeWidthWidth of division line that divides each data axisnumber1
divisionStrokeOpacityOpacity of stroke of division line that divides each data axisnumber0.5
isCircleWhether the chart is circularbooleanfalse

Contributing

Contributions are always welcome!

License

MIT

0.0.20

9 months ago

0.0.21

9 months ago

0.0.22

9 months ago

0.0.23

9 months ago

0.0.24

9 months ago

0.0.25

9 months ago

0.0.16

10 months ago

0.0.17

10 months ago

0.0.18

10 months ago

0.0.19

10 months ago

0.0.26

9 months ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

12 months ago

0.0.14

12 months ago

0.0.15

12 months ago

0.0.9

1 year ago

0.0.8

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago