0.1.0 • Published 3 years ago

react-native-bar-chart v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-bar-chart

Bar chart for react native

Installation

npm install react-native-bar-chart

Usage

import BarChart from 'react-native-bar-chart';

// ...

// data can be one or two dimensional Array
const data = [
  [70, -5],
  [80, -10],
  [110, 0],
  [100, 0],
  [280, -60],
];
// labels
const horizontalData = ['April', 'May', 'June', 'July', 'August'];

<BarChart data={data} horizontalData={horizontalData} />;

Props

NameDescriptionRequired
dataone or two dimensional array of numberstrue
horizontalDataarray of stringtrue
backgroundColorstring for background color of chartfalse
barColorstring for bar colorfalse
secondBarColorstring for second bar color (if the array is two dimensional)false
heightheight of chartfalse
prefixstring for labelsfalse
suffixstring for labelsfalse
barLabelColorstring for color of text on top of the barfalse
labelColorstring for color of labelsfalse

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT