react-native-pie-chart
Version:
pie chart for react native
36 lines (35 loc) • 1.23 kB
TypeScript
import { JSX } from 'react';
import { StyleProp, ViewStyle } from 'react-native';
export type Props = {
/**
* Diameter of the chart. In otherwords, size of the square that wraps the chart's circle.
*/
widthAndHeight: number;
/**
* Chart's data. Should be a list of all positive (or zero) numbers.
* The sum of the series cannot be zero.
*/
series: number[];
/**
* Color of each slice. The first element is the color of the first slice,
* the second one is the color of the second slice, and so on.
* The size of the `sliceColor` array should be equal to the size of the `series` array.
*/
sliceColor: string[];
/**
* Color of the doughnut's hole.
* Don't provide it or set it to null to make it transparent.
*/
coverFill?: string | null;
/**
* Size of the doughnut's hole, in percentage.
* Should be between zero and one.
*/
coverRadius?: number;
/**
* React-native's style object. This will apply to the chart's SVG.
*/
style?: StyleProp<ViewStyle>;
};
declare const PieChart: ({ widthAndHeight, series, sliceColor, coverFill, coverRadius, style, }: Props) => JSX.Element;
export default PieChart;