{"_id":"react-native-svg-charts-updated-peers","name":"react-native-svg-charts-updated-peers","dist-tags":{"latest":"5.3.1"},"versions":{"5.3.1":{"name":"react-native-svg-charts-updated-peers","version":"5.3.1","private":false,"description":"Customizable charts (Line, Bar, Area, Pie, Circle, Progress) for React Native","main":"lib/module/index.js","module":"lib/module/index.js","react-native":"src/index.js","scripts":{"start":"node node_modules/react-native/local-cli/cli.js start","test":"jest","storybook":"storybook start -p 7008","eslint":"eslint .","prepare":"bob build"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"lint-staged":{"*.js":"eslint"},"keywords":["react-native","react-component","react-native-component","react","mobile","ios","android","vector","charts","chart","d3"],"author":{"name":"Andrei Brumaru","email":"andrei.brumaru@quickleaf.net"},"homepage":"https://github.com/AndreiBru/react-native-svg-charts","bugs":{"url":"https://github.com/AndreiBru/react-native-svg-charts/issues"},"repository":{"type":"git","url":"git://github.com/AndreiBru/react-native-svg-charts.git"},"license":"MIT","dependencies":{"d3-array":"^1.2.0","d3-interpolate-path":"2.0.0","d3-scale":"^1.0.6","d3-shape":"^1.0.6","prop-types":"^15.6.0"},"peerDependencies":{"react":">=16.0.0-alpha.12","react-native":">=0.46.0","react-native-svg":">=6.2.1"},"devDependencies":{"@react-native-community/bob":"^0.10.0","@storybook/addon-actions":"^3.2.14","@storybook/addon-knobs":"^3.2.14","@storybook/addon-links":"^3.2.14","@storybook/react-native":"^3.2.14","babel-eslint":"^7.2.3","babel-jest":"20.0.1","babel-preset-react-native":"1.9.1","date-fns":"^1.28.5","eslint":"^4.19.0","eslint-config-standard":"^10.2.1","eslint-plugin-import":"^2.6.0","eslint-plugin-node":"^5.1.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-react":"^7.7.0","eslint-plugin-react-native":">=2.3.2","eslint-plugin-standard":"^3.0.1","husky":"^3.0.0","jest":"20.0.1","lint-staged":"^7.1.3","prettier":"^1.18.2","pretty-quick":"^1.11.1","react":"16.2.0","react-dom":">=16.0.0-alpha.12","react-native":"0.52.2","react-native-svg":"^6.2.1","react-test-renderer":"16.0.0-alpha.6"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/lib/"]},"@react-native-community/bob":{"source":"src","output":"lib","targets":["module"]},"eslintIgnore":["node_modules/","lib/"],"gitHead":"83f390130aaa394db5db53617f6c6c427afaa161","_id":"react-native-svg-charts-updated-peers@5.3.1","_nodeVersion":"11.15.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-UghwPn3/zOq5P500L3zDJ57Yj48fNojmOhVERgo6yZvuvnqVVv70iUfH1+ZbIIEVhDkRbKVQRk3EhWQUUSjFgw==","shasum":"291f4483ecebe173a869a226307b48f3e4ff2a47","tarball":"https://registry.npmjs.org/react-native-svg-charts-updated-peers/-/react-native-svg-charts-updated-peers-5.3.1.tgz","fileCount":90,"unpackedSize":406980,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIHFpYv4JwrFo+amU/XNzTR4cCfaAAHmp7joJylEiAsZvAh8oueamC+tR0tb3FqYi0u1Y2x5sN7pLf956MEW75A34"}]},"_npmUser":{"name":"andreibru","email":"andrei.brumaru8@gmail.com"},"directories":{},"maintainers":[{"name":"andreibru","email":"andrei.brumaru8@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-svg-charts-updated-peers_5.3.1_1700143241449_0.381691008414885"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-16T14:00:41.448Z","5.3.1":"2023-11-16T14:00:41.811Z","modified":"2023-11-16T14:00:42.140Z"},"maintainers":[{"name":"andreibru","email":"andrei.brumaru8@gmail.com"}],"description":"Customizable charts (Line, Bar, Area, Pie, Circle, Progress) for React Native","homepage":"https://github.com/AndreiBru/react-native-svg-charts","keywords":["react-native","react-component","react-native-component","react","mobile","ios","android","vector","charts","chart","d3"],"repository":{"type":"git","url":"git://github.com/AndreiBru/react-native-svg-charts.git"},"author":{"name":"Andrei Brumaru","email":"andrei.brumaru@quickleaf.net"},"bugs":{"url":"https://github.com/AndreiBru/react-native-svg-charts/issues"},"license":"MIT","readme":"# DISCLAIMER:\n\nThis is a copy of the official `react-native-svg-charts` library (docs below), with the peerDependencies updated to avoid possibly running into legacy peer dependency issues.\n\n# react-native-svg-charts\n\n[![version](https://img.shields.io/npm/v/react-native-svg-charts.svg)](https://www.npmjs.com/package/react-native-svg-charts)\n[![downloads](https://img.shields.io/npm/dm/react-native-svg-charts.svg)](https://www.npmjs.com/package/react-native-svg-charts)\n[![license](https://img.shields.io/npm/l/react-native-svg-charts.svg)](https://www.npmjs.com/package/react-native-svg-charts)\n\nWelcome to react-native-svg-charts!\n\n`react-native-svg-charts` provides SVG Charts support to React Native on iOS and Android, and a compatibility layer for the web.\n\n### Looking for maintainers! I alone don't have the time to maintain this library anymore. Preferably looking for somebody who uses this library in their proffesional work (how I originally got the time to maintain).\n\n### version 5 is now available!\n\nA much improved decorator system has been introduced, allowing for greater flexibility and less complexity.\nSee [releases](https://github.com/JesperLekland/react-native-svg-charts/releases) for more information.\n\n---\n\nIn order to not bloat this README too much we've moved some examples over to\n[`react-native-svg-charts-examples`](https://github.com/JesperLekland/react-native-svg-charts-examples).\nThere we will try to showcase the really cool things you can do with this library.\nThis README will try to keep things as simple as possible so that everybody can get up and running as fast as possible.\n\n## Prerequisites\n\nThis library uses [react-native-svg](https://github.com/react-native-community/react-native-svg)\nto render its graphs. Therefore this library needs to be installed **AND** linked into your project to work.\n\nOther than the above dependency this library uses pure javascript and supports both iOS and Android\n\n## Getting Started\n\n> Make sure to follow the installation mentioned in the [Prerequisites](#Prerequisites)\n\nThen you can install the library using either yarn:\n\n```\nyarn add react-native-svg-charts\n```\n\nor npm:\n\n```\nnpm install --save react-native-svg-charts\n```\n\nNow you're good to go!\n\n## Motivation\n\nCreating beautiful graphs in React Native shouldn't be hard or require a ton of knowledge.\nWe use [react-native-svg](https://github.com/react-native-community/react-native-svg) in order to render our SVG's and to provide you with great extensibility.\nWe utilize the very popular [d3](https://d3js.org/) library to create our SVG paths and to calculate the coordinates.\n\nWe built this library to be as extensible as possible while still providing you with the most common charts and data visualization tools out of the box.\nWe're very proud of our \"decorator\" support. All charts can be extended with \"decorators\", a component that somehow styles or enhances your chart.\nSimply pass in a `react-native-svg` compliant component as a child to the graph and it will be called with all the necessary information to layout your decorator.\nSee each chart for information on what data the decorator will be called with.\n\nFeedback and PR's are more than welcome 🙂\n\n## Running\n\nIf you want to test out the library you can clone this repository and run it.\nWe suggest that you test out the [storybooks](https://github.com/storybooks/storybook) that we've implemented.\nMost of the charts are implemented with [knobs](https://github.com/storybooks/storybook/tree/master/addons/knobs) so that you can tweak most properties and see their behavior live.\n\nClone the repo and run the following:\n\n```bash\nyarn\n\n# for iOS\n(cd ios && pod install)\nreact-native run-ios\n\n# for Android\nreact-native run-android\n\nyarn storybook\n\n# and then reload your device\n```\n\n## Common Props\n\n| Property          | Default                                  | Description                                                                                                                                                                                                                                                    |\n| ----------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| data              | **required**                             | An array of arbitrary data - use prop `xAccessor`/`yAccessor`to tell the chart about the data structure                                                                                                                                                        |\n| yAccessor         | ({ item }) => item                       | A function that takes each entry of `data` (named \"item\") as well as the index and returns the y-value of that entry                                                                                                                                           |\n| xAccessor         | ({ index }) => index                     | Same as `yAccessor` but returns the x-value of that entry                                                                                                                                                                                                      |\n| yScale            | d3Scale.scaleLinear                      | A function that determines the scale of said axis (only tested with scaleLinear, scaleTime & scaleBand )                                                                                                                                                       |\n| xScale            | d3Scale.scaleLinear                      | Same as `yScale` but for the x axis                                                                                                                                                                                                                            |\n| svg               | `{}`                                     | an object containing all the props that should be passed down to the underlying `react-native-svg` component. [See available props](https://github.com/react-native-community/react-native-svg#common-props)                                                   |\n| animate           | false                                    | PropTypes.bool                                                                                                                                                                                                                                                 |\n| animationDuration | 300                                      | PropTypes.number                                                                                                                                                                                                                                               |\n| style             | undefined                                | Supports all [ViewStyleProps](https://facebook.github.io/react-native/docs/view-style-props)                                                                                                                                                                   |\n| curve             | d3.curveLinear                           | A function like [this](https://github.com/d3/d3-shape#curves)                                                                                                                                                                                                  |\n| contentInset      | { top: 0, left: 0, right: 0, bottom: 0 } | An object that specifies how much fake \"margin\" to use inside of the SVG canvas. This is particularly helpful on Android where `overflow: \"visible\"` isn't supported and might cause clipping. Note: important to have same contentInset on axis's and chart   |\n| numberOfTicks     | 10                                       | We use [d3-array](https://github.com/d3/d3-array#ticks) to evenly distribute the grid and dataPoints on the yAxis. This prop specifies how many \"ticks\" we should try to render. Note: important that this prop is the same on both the chart and on the yAxis |\n| showGrid          | true                                     | Whether or not to show the grid lines                                                                                                                                                                                                                          |\n| yMin              | undefined                                | Alter how the chart bounds are calculated                                                                                                                                                                                                                      |\n| yMax              | undefined                                | Alter how the chart bounds are calculated                                                                                                                                                                                                                      |\n| xMin              | undefined                                | Alter how the chart bounds are calculated                                                                                                                                                                                                                      |\n| xMax              | undefined                                | Alter how the chart bounds are calculated                                                                                                                                                                                                                      |\n| children          | undefined                                | One or many `react-native-svg` components that will be used to enhance your chart                                                                                                                                                                              |\n\n## Common arguments to children\n\n| Property | Description                                                                                                             |\n| -------- | ----------------------------------------------------------------------------------------------------------------------- |\n| x        | a function that normally accepts the index of a data point an returns its 'x' location on the canvas                    |\n| y        | a function that normally accepts the value of a data point an returns its 'y' location on the canvas                    |\n| width    | the width of the canvas in pixels                                                                                       |\n| height   | the height of the canvas in pixels                                                                                      |\n| data     | the same data array provided to the chart, use this to map over your data points if you want decorators on each point   |\n| ticks    | if `numberOfTicks` has been provided to the chart this array will include the calculated tick values (useful for grids) |\n\n## Components\n\nThis library currently provides the following components\n\n-   [Area](#areachart)\n-   [StackedAreaChart](#stackedareachart)\n-   [Bar](#barchart)\n-   [StackedBarChart](#stackedbarchart)\n-   [Line](#linechart)\n-   [Pie](#piechart)\n-   [ProgressCircle](#progresscircle)\n-   [YAxis](#yaxis)\n-   [XAxis](#xaxis)\n\nAlso see\n\n-   [Children](#children)\n-   [Grid](#grid)\n\n### AreaChart\n\n![Area chart](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/area-chart.png)\n\n#### Example\n\n```jsx\nimport React from 'react'\nimport { AreaChart, Grid } from 'react-native-svg-charts'\nimport * as shape from 'd3-shape'\n\nclass AreaChartExample extends React.PureComponent {\n    render() {\n        const data = [50, 10, 40, 95, -4, -24, 85, 91, 35, 53, -53, 24, 50, -20, -80]\n\n        return (\n            <AreaChart\n                style={{ height: 200 }}\n                data={data}\n                contentInset={{ top: 30, bottom: 30 }}\n                curve={shape.curveNatural}\n                svg={{ fill: 'rgba(134, 65, 244, 0.8)' }}\n            >\n                <Grid />\n            </AreaChart>\n        )\n    }\n}\n```\n\n#### Props\n\nSee [Common Props](#common-props)\n\n| Property | Default | Description                                                                  |\n| -------- | ------- | ---------------------------------------------------------------------------- |\n| start    | 0       | The value of which the area should start (will always end on the data point) |\n\n#### Arguments to children\n\nSupports all [Common arguments to children](#common-arguments-to-children)\n\n### StackedAreaChart\n\nVery similar to an area chart but with multiple sets of data stacked together.\nWe suggest that you read up on [d3 stacks](https://github.com/d3/d3-shape#stacks) in order to better understand this chart and its props\nSee [Area stack chart with Y axis](https://github.com/JesperLekland/react-native-svg-charts-examples/blob/master/storybook/stories/area-stack/with-y-axis.js) to see how to use a YAxis with this component\nUse the `svgs` prop to pass in `react-native-svg` compliant props to each area.\n\n![Stacked area chart](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/area-stack.png)\n\n#### Example\n\n```jsx\nimport React from 'react'\nimport { StackedAreaChart } from 'react-native-svg-charts'\nimport * as shape from 'd3-shape'\n\nclass StackedAreaExample extends React.PureComponent {\n    render() {\n        const data = [\n            {\n                month: new Date(2015, 0, 1),\n                apples: 3840,\n                bananas: 1920,\n                cherries: 960,\n                dates: 400,\n            },\n            {\n                month: new Date(2015, 1, 1),\n                apples: 1600,\n                bananas: 1440,\n                cherries: 960,\n                dates: 400,\n            },\n            {\n                month: new Date(2015, 2, 1),\n                apples: 640,\n                bananas: 960,\n                cherries: 3640,\n                dates: 400,\n            },\n            {\n                month: new Date(2015, 3, 1),\n                apples: 3320,\n                bananas: 480,\n                cherries: 640,\n                dates: 400,\n            },\n        ]\n\n        const colors = ['#8800cc', '#aa00ff', '#cc66ff', '#eeccff']\n        const keys = ['apples', 'bananas', 'cherries', 'dates']\n        const svgs = [\n            { onPress: () => console.log('apples') },\n            { onPress: () => console.log('bananas') },\n            { onPress: () => console.log('cherries') },\n            { onPress: () => console.log('dates') },\n        ]\n\n        return (\n            <StackedAreaChart\n                style={{ height: 200, paddingVertical: 16 }}\n                data={data}\n                keys={keys}\n                colors={colors}\n                curve={shape.curveNatural}\n                showGrid={false}\n                svgs={svgs}\n            />\n        )\n    }\n}\n```\n\n#### Props\n\n| Property | Default                                                              | Description                                                               |\n| -------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------- |\n| data     | **required**                                                         | An array of the data entries                                              |\n| keys     | **required**                                                         | This array should contain the object keys of interest (see above example) |\n| colors   | **required**                                                         | An array of equal size as `keys` with the color for each key              |\n| order    | [d3.stackOrderNone](https://github.com/d3/d3-shape#stackOrderNone)   | The order in which to sort the areas                                      |\n| offset   | [d3.stackOffsetNone](https://github.com/d3/d3-shape#stackOffsetNone) | A function to determine the offset of the areas                           |\n\nAlso see [Common Props](#common-props)\n\n#### Arguments to children\n\n| Property | Description                                                                                                              |\n| -------- | ------------------------------------------------------------------------------------------------------------------------ |\n| x        | a function that normally accepts the index of a data points an returns its 'x' location on the canvas                    |\n| y        | a function that normally accepts the value of a data points an returns its 'y' location on the canvas                    |\n| width    | the width of the canvas in pixels                                                                                        |\n| height   | the height of the canvas in pixels                                                                                       |\n| ~~data~~ | ~~the same data array provided to the chart, use this to map over your data points if you want decorators on each point~ |\n| ticks    | if `numberOfTicks` has been provided to the chart this array will include the calculated tick values (useful for grids)  |\n\nThis chart does not call a child with the `data` argument. This is due to the fact that a lot of calculations go into\ncreating the stacked chart, meaning that the original `data` prop doesn't provide especially valuable information\nwhen trying to layout decorators. It does however call with the rest of the [common arguments](#common-arguments-to-children)\n\n### BarChart\n\n![Bar chart](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/bar-chart.png)\n\n#### Example\n\n```jsx\nimport React from 'react'\nimport { BarChart, Grid } from 'react-native-svg-charts'\n\nclass BarChartExample extends React.PureComponent {\n    render() {\n        const fill = 'rgb(134, 65, 244)'\n        const data = [50, 10, 40, 95, -4, -24, null, 85, undefined, 0, 35, 53, -53, 24, 50, -20, -80]\n\n        return (\n            <BarChart style={{ height: 200 }} data={data} svg={{ fill }} contentInset={{ top: 30, bottom: 30 }}>\n                <Grid />\n            </BarChart>\n        )\n    }\n}\n```\n\n### Props\n\nAlso see [Common Props](#common-props)\n\n| Property     | Default                                    | Description                                                                                                                                                                                                                                                                                                                                                                             |\n| ------------ | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| data         | **required**                               | The data prop in a barChart can look exactly like in a Line- or AreaChart, i.e an array of just numbers or complex objects. It can however also be an array with several data sets. A data object can contain a `svg` property which allows you two override styles on that specific object. See [the examples repo](https://github.com/JesperLekland/react-native-svg-charts-examples) |\n| horizontal   | false                                      | Boolean whether or not the bars should be horizontal                                                                                                                                                                                                                                                                                                                                    |\n| svg          | `{}`                                       | Default svg props **for all bars**. Supports all svg props an svg path normally supports. This styles will be overriden if there are specific styles for a given data object                                                                                                                                                                                                            |\n| spacingInner | 0.05                                       | Spacing between the bars (or groups of bars)                                                                                                                                                                                                                                                                                                                                            |\n| spacingOuter | 0.05                                       | Spacing outside of the bars (or groups of bars). Percentage of one bars width                                                                                                                                                                                                                                                                                                           |\n| contentInset | `{ top: 0, left: 0, right: 0, bottom: 0 }` | PropTypes.shape                                                                                                                                                                                                                                                                                                                                                                         |\n\n#### Arguments to children\n\n| Property  | Description                     |\n| --------- | ------------------------------- |\n| bandwidth | the width of a band (a.k.a bar) |\n\nAlso supports all [Common arguments to children](#common-arguments-to-children)\n\n### StackedBarChart\n\nThe same as the [StackedAreaChart](#stackedareachart) except with bars (and different `svgs` prop).\nWe suggest that you read up on [d3 stacks](https://github.com/d3/d3-shape#stacks) in order to better understand this chart and its props\n\nThe `svgs` prop here is not based on keys, but rather entries, as the user might want to specify different props\nfor each entry in each bar. Therefore each key entry can contain a complex object that contains e.g an `svg` prop. See [this example](./storybook/stories/bar-stack/with-on-press.js) for inspiration\n\n![Stacked bar chart](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/bar-stack.png)\n![Stacked bar chart - horizontal](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/bar-stack-horizontal.png)\n\n#### Example\n\n```jsx\nimport React from 'react'\nimport { StackedBarChart } from 'react-native-svg-charts'\n\nclass StackedBarChartExample extends React.PureComponent {\n    render() {\n        const data = [\n            {\n                month: new Date(2015, 0, 1),\n                apples: 3840,\n                bananas: 1920,\n                cherries: 960,\n                dates: 400,\n                oranges: 400,\n            },\n            {\n                month: new Date(2015, 1, 1),\n                apples: 1600,\n                bananas: 1440,\n                cherries: 960,\n                dates: 400,\n            },\n            {\n                month: new Date(2015, 2, 1),\n                apples: 640,\n                bananas: 960,\n                cherries: 3640,\n                dates: 400,\n            },\n            {\n                month: new Date(2015, 3, 1),\n                apples: 3320,\n                bananas: 480,\n                cherries: 640,\n                dates: 400,\n            },\n        ]\n\n        const colors = ['#7b4173', '#a55194', '#ce6dbd', '#de9ed6']\n        const keys = ['apples', 'bananas', 'cherries', 'dates']\n\n        return (\n            <StackedBarChart\n                style={{ height: 200 }}\n                keys={keys}\n                colors={colors}\n                data={data}\n                showGrid={false}\n                contentInset={{ top: 30, bottom: 30 }}\n            />\n        )\n    }\n}\n```\n\n#### Props\n\n| Property      | Default                                                              | Description                                                                                                      |\n| ------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |\n| data          | **required**                                                         | An array of the data entries: each value can be a number or a complex object with custom `svg` props for example |\n| keys          | **required**                                                         | This array should contain the object keys of interest (see above example)                                        |\n| colors        | **required**                                                         | An array of equal size as `keys` with the color for each key                                                     |\n| valueAccessor | ({ item, key }) => item[key]                                         | Very similar to the `yAccessor` of the other charts, usually needed when using complex objects as values         |\n| horizontal    | false                                                                | Boolean whether or not the bars should be horizontal                                                             |\n| order         | [d3.stackOrderNone](https://github.com/d3/d3-shape#stackOrderNone)   | The order in which to sort the areas                                                                             |\n| offset        | [d3.stackOffsetNone](https://github.com/d3/d3-shape#stackOffsetNone) | A function to determine the offset of the areas                                                                  |\n\nAlso see [Common Props](#common-props)\n\n#### Arguments to children\n\n| Property | Description                                                                                                               |\n| -------- | ------------------------------------------------------------------------------------------------------------------------- |\n| x        | a function that normally accepts the index of a data points an returns its 'x' location on the canvas                     |\n| y        | a function that normally accepts the value of a data points an returns its 'y' location on the canvas                     |\n| width    | the width of the canvas in pixels                                                                                         |\n| height   | the height of the canvas in pixels                                                                                        |\n| ~~data~~ | ~~the same data array provided to the chart, use this to map over your data points if you want decorators on each point~~ |\n| ticks    | if `numberOfTicks` has been provided to the chart this array will include the calculated tick values (useful for grids)   |\n\nThis chart does not call a child with the `data` argument. This is due to the fact that a lot of calculations go into\ncreating the stacked chart, meaning that the original `data` prop doesn't provide especially valuable information\nwhen trying to layout decorators. It does however call with the rest of the [common arguments](#common-arguments-to-children)\n\n### LineChart\n\n![Line chart](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/line-chart.png)\n\n#### Example\n\n```jsx\nimport React from 'react'\nimport { LineChart, Grid } from 'react-native-svg-charts'\n\nclass LineChartExample extends React.PureComponent {\n    render() {\n        const data = [50, 10, 40, 95, -4, -24, 85, 91, 35, 53, -53, 24, 50, -20, -80]\n\n        return (\n            <LineChart\n                style={{ height: 200 }}\n                data={data}\n                svg={{ stroke: 'rgb(134, 65, 244)' }}\n                contentInset={{ top: 20, bottom: 20 }}\n            >\n                <Grid />\n            </LineChart>\n        )\n    }\n}\n```\n\n#### Props\n\nSee [Common Props](#common-props)\n\n#### Arguments to children\n\nSupports all [Common arguments to children](#common-arguments-to-children)\n\n### PieChart\n\nThe PieChart is a really nice component with great support for custom behavior.\nSee more examples in the [examples repo](https://github.com/JesperLekland/react-native-svg-charts-examples)\n\n![Pie chart](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/pie-chart.png)\n\n#### Example\n\n```jsx\nimport React from 'react'\nimport { PieChart } from 'react-native-svg-charts'\n\nclass PieChartExample extends React.PureComponent {\n    render() {\n        const data = [50, 10, 40, 95, -4, -24, 85, 91, 35, 53, -53, 24, 50, -20, -80]\n\n        const randomColor = () => ('#' + ((Math.random() * 0xffffff) << 0).toString(16) + '000000').slice(0, 7)\n\n        const pieData = data\n            .filter((value) => value > 0)\n            .map((value, index) => ({\n                value,\n                svg: {\n                    fill: randomColor(),\n                    onPress: () => console.log('press', index),\n                },\n                key: `pie-${index}`,\n            }))\n\n        return <PieChart style={{ height: 200 }} data={pieData} />\n    }\n}\n```\n\n#### Props\n\n| Property      | Default                      | Description                                                                                                                                                                                                                                                                                                                                 |\n| ------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| data          | **required**                 | Very similar to the data prop of our other charts, the only exception is that the PieChart only accepts complex objects (not just numbers). An item can also contain the `arc` property which allows you two override settings on that specific arc. See [examples repo](https://github.com/JesperLekland/react-native-svg-charts-examples) |\n| valueAccessor | ({ item }) => item.value     | Very similar to the `yAccessor` of the other charts                                                                                                                                                                                                                                                                                         |\n| outerRadius   | \"100%\"                       | The outer radius, use this to tweak how close your pie is to the edge of it's container. Takes either percentages or absolute numbers (pixels)                                                                                                                                                                                              |\n| innerRadius   | \"50%\"                        | The inner radius, use this to create a donut. Takes either percentages or absolute numbers (pixels)                                                                                                                                                                                                                                         |\n| labelRadius   | undefined                    | The radius of the circle that will help you layout your labels. Takes either percentages or absolute numbers (pixels)                                                                                                                                                                                                                       |\n| padAngle      |                              | The angle between the slices                                                                                                                                                                                                                                                                                                                |\n| startAngle    | 0                            | The start angle in radians of the entire pie                                                                                                                                                                                                                                                                                                |\n| endAngle      | Math.PI \\* 2                 | The end angle in radians of the entire pie                                                                                                                                                                                                                                                                                                  |\n| sort          | `(a,b) => b.value - a.value` | Like any normal sort function it expects either 0, a positive or negative return value. The arguments are each an object from the `dataPoints` array                                                                                                                                                                                        |\n\n#### Arguments to children\n\n| Property | Description                                                                                                           |\n| -------- | --------------------------------------------------------------------------------------------------------------------- |\n| width    | the width of the canvas in pixels                                                                                     |\n| height   | the height of the canvas in pixels                                                                                    |\n| slices   | an array of the pie chart slices. See source code and examples for what it includes                                   |\n| data     | the same data array provided to the chart, use this to map over your data points if you want decorators on each point |\n\n### ProgressCircle\n\n![Progress circle](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/progress-circle.png)\n\n#### Example\n\n```jsx\nimport React from 'react'\nimport { ProgressCircle } from 'react-native-svg-charts'\n\nclass ProgressCircleExample extends React.PureComponent {\n    render() {\n        return <ProgressCircle style={{ height: 200 }} progress={0.7} progressColor={'rgb(134, 65, 244)'} />\n    }\n}\n```\n\n#### Props\n\n| Property        | Default       | Description                 |\n| --------------- | ------------- | --------------------------- |\n| progress        | **required**  | PropTypes.number.isRequired |\n| progressColor   | 'black'       | PropTypes.any               |\n| backgroundColor | '#ECECEC'     | PropTypes.any               |\n| startAngle      | `0`           | PropTypes.number            |\n| endAngle        | `Math.PI * 2` | PropTypes.number            |\n| strokeWidth     | 5             | PropTypes.number            |\n| cornerRadius    | 45            | PropTypes.number            |\n\n#### Arguments to children\n\n| Property | Description                                                                                                           |\n| -------- | --------------------------------------------------------------------------------------------------------------------- |\n| width    | the width of the canvas in pixels                                                                                     |\n| height   | the height of the canvas in pixels                                                                                    |\n| data     | the same data array provided to the chart, use this to map over your data points if you want decorators on each point |\n\n### YAxis\n\n![Y-axis](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/y-axis.png)\n\nA helper component to layout your Y-axis labels on the same coordinates as your chart.\nIt's very important that the component has the exact same view bounds (preferably wrapped in the same parent view) as the chart it's supposed to match.\nIf the chart has property `contentInset` set it's very important that the YAxis has the same vertical contentInset.\n\n#### Example\n\n```jsx\nimport React from 'react'\nimport { LineChart, YAxis, Grid } from 'react-native-svg-charts'\nimport { View } from 'react-native'\n\nclass YAxisExample extends React.PureComponent {\n    render() {\n        const data = [50, 10, 40, 95, -4, -24, 85, 91, 35, 53, -53, 24, 50, -20, -80]\n\n        const contentInset = { top: 20, bottom: 20 }\n\n        return (\n            <View style={{ height: 200, flexDirection: 'row' }}>\n                <YAxis\n                    data={data}\n                    contentInset={contentInset}\n                    svg={{\n                        fill: 'grey',\n                        fontSize: 10,\n                    }}\n                    numberOfTicks={10}\n                    formatLabel={(value) => `${value}ºC`}\n                />\n                <LineChart\n                    style={{ flex: 1, marginLeft: 16 }}\n                    data={data}\n                    svg={{ stroke: 'rgb(134, 65, 244)' }}\n                    contentInset={contentInset}\n                >\n                    <Grid />\n                </LineChart>\n            </View>\n        )\n    }\n}\n```\n\n#### Props\n\n(see [Common Props](#common-props))\n\n| Property     | Default               | Description                                                                                                                                        |\n| ------------ | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| scale        | `d3Scale.scaleLinear` | Should be the same as passed into the charts `yScale`, _or_ d3Scale.scaleBand if used in conjunction with a horizontal BarChart                    |\n| svg          | `{}`                  | supports all svg props an svg text normally supports                                                                                               |\n| spacingInner | 0.05                  | Spacing between the labels. Only applicable if `scale=d3Scale.scaleBand` and should then be equal to `spacingInner` prop on the actual BarChart    |\n| spacingOuter | 0.05                  | Spacing outside of the labels. Only applicable if `scale=d3Scale.scaleBand` and should then be equal to `spacingOuter` prop on the actual BarChart |\n| formatLabel  | `value => {}`         | A utility function to format the text before it is displayed, e.g `value => \"\\$\" + value                                                           |\n| contentInset | { top: 0, bottom: 0 } | Used to sync layout with chart (if same prop used there)                                                                                           |\n| min          | undefined             | Used to sync layout with chart (if gridMin is used there)                                                                                          |\n| max          | undefined             | Used to sync layout with chart (if gridMax is used there)                                                                                          |\n\n#### Arguments to children\n\nNo arguments\n\n### XAxis\n\n![Line chart](https://raw.githubusercontent.com/jesperlekland/react-native-svg-charts/master/screenshots/x-axis.png)\n\nA helper component to layout your X-axis labels on the same coordinates as your chart.\nIt's very important that the component has the exact same view bounds (preferably wrapped in the same parent view) as the chart it's supposed to match.\nIf the chart has property `contentInset` set it's very important that the XAxis has the same horizontal contentInset.\n\nThe XAxis also supports the `xAccessor` prop, if it's not supplied it will assume that you're only interested in the index of the data set.\n\n#### Example\n\n```jsx\nimport React from 'react'\nimport { LineChart, XAxis, Grid } from 'react-native-svg-charts'\nimport { View } from 'react-native'\n\nclass XAxisExample extends React.PureComponent {\n    render() {\n        const data = [50, 10, 40, 95, -4, -24, 85, 91, 35, 53, -53, 24, 50, -20, -80]\n\n        return (\n            <View style={{ height: 200, padding: 20 }}>\n                <LineChart\n                    style={{ flex: 1 }}\n                    data={data}\n                    gridMin={0}\n                    contentInset={{ top: 10, bottom: 10 }}\n                    svg={{ stroke: 'rgb(134, 65, 244)' }}\n                >\n                    <Grid />\n                </LineChart>\n                <XAxis\n                    style={{ marginHorizontal: -10 }}\n                    data={data}\n                    formatLabel={(value, index) => index}\n                    contentInset={{ left: 10, right: 10 }}\n                    svg={{ fontSize: 10, fill: 'black' }}\n                />\n            </View>\n        )\n    }\n}\n```\n\n#### Props\n\n| Property     | Default               | Description                                                                                                                                                                                                                                                                                                                                             |\n| ------------ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| data         | **required**          | An array of values or objects to render on the xAxis. Should preferably have the same length as the chart's dataPoints. If a complex object is used instead of a simple value, a `xAccessor` prop **is required** to calculate the axis' extent. A data object can contain a `svg` property which allows you to override styles on that specific object |\n| scale        | `d3Scale.scaleLinear` | Should be the same as passed into the charts `xScale`                                                                                                                                                                                                                                                                                                   |\n| spacingInner | 0.05                  | Spacing between the labels. Only applicable if `scale=d3Scale.scaleBand` and should then be equal to `spacingInner` prop on the actual BarChart                                                                                                                                                                                                         |\n| spacingOuter | 0.05                  | Spacing between the labels. Only applicable if `scale=d3Scale.scaleBand` and should then be equal to `spacingOuter` prop on the actual BarChart                                                                                                                                                                                                         |\n| svg          | `{}`                  | Default svg props **for all labels**. Supports all svg props an svg text normally supports. This styles will be overriden if there are specific styles for a given data object                                                                                                                                                                          |\n| formatLabel  | `value => value`      | A utility function to format the text before it is displayed, e.g `value => \"day\" + value`. Passes back the value provided by the `xAccessor`                                                                                                                                                                                                           |\n| contentInset | { left: 0, right: 0 } | Used to sync layout with chart (if same prop used there)                                                                                                                                                                                                                                                                                                |\n\n#### Arguments to children\n\nNo arguments\n\n### Children\n\nNew for version 5.0.\nEach chart (and axes) component now accepts React children. _Important_ note is that all children must be a `react-native-svg` component\non order for it to be rendered by the chart. This API deprecates the old one with `extras` and `decorators`.\nEverything that should be rendered above or below the chart should now be supplied as a child to said chart.\nThis allows you to declare the order in which your decorators should be rendered. If you want anything rendered below the chart,\nsimply add the prop `belowChart={true}`. There's a ton of examples in the [examples repo](https://github.com/JesperLekland/react-native-svg-charts-examples), go and have a look.\n\n### Grid\n\nThis library provides a helper component for drawing grids.\nSimply place it as child to the chart of your choice and (if necessary) set its direction.\n\n#### Props\n\n| Property   | Default                   | Description                                                                                                                                                                                                  |\n| ---------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| svg        | `{}`                      | an object containing all the props that should be passed down to the underlying `react-native-svg` component. [See available props](https://github.com/react-native-community/react-native-svg#common-props) |\n| direction  | Grid.Direction.HORIZONTAL | The direction of the grid lines.                                                                                                                                                                             |\n| belowChart | true                      | whether or not to render below the chart                                                                                                                                                                     |\n\n### Examples\n\nThere are tons of examples over at [react-native-svg-chart-examples](https://github.com/JesperLekland/react-native-svg-charts-examples)\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}