0.1.2 • Published 8 months ago

react-native-arc-chart-view v0.1.2

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

react-native-arc-chart-view

Arc chart component built for react native based on ArcChartView

Installation (Expo only)

yarn add react-native-arc-chart-view
npx expo prebuild

Usage

import { ReactNativeArcChartView } from "react-native-arc-chart-view";

<ReactNativeArcChartView
  sectionsCount={6}
  iconSize={60}
  sectionsSpace={5}
  linesCount={10}
  midStartExtraOffset={10}
  sectionsIcons={images}
  onFinishedSettingSectionValue={({
    nativeEvent: { sectionPos, sectionValue },
  }) => {
    console.log(sectionPos, sectionValue);
  }}
/>;

Props

AttributeTypeDescription
linesCountnumberlines count of chart (i mean arc lines), default value is 10
linesSpacenumberlines space (lines margin), default value is 4dp
linesWidthnumberlines width , default value is 6dp
sectionsCountnumbersections count , default value is 8
sectionsSpacenumbersections space (sections margin) , default value is 4dp
midStartExtraOffsetnumbercenter extra offest size, default value is 16dp
iconSizenumberthe icons size, default value is 32dp
sectionsIconsstring[]array of the icons for the chart sections
sectionsValuesnumber[]array of the values for the chart sections
onStartSettingSectionValue{sectionPos: number, sectionValue:number}a callback to get the value of the changing section on start of the action
onContinueSettingSectionValue{sectionPos: number, sectionValue:number}a callback to get the value of the changing section on drag action
onFinishedSettingSectionValue{sectionPos: number, sectionValue:number}a callback to get the value of the changing section on finish

TODO

  • Android support
  • iOS support
  • Web support