You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -162,15 +162,16 @@ Supports all [Common arguments to children](#common-arguments-to-children)
162
162
163
163
### StackedAreaChart
164
164
165
-
Very similar to an area chart but with multiple sets of data stacked together. Notice that the `dataPoints` prop has changed to `data` and have a different signature.
165
+
Very similar to an area chart but with multiple sets of data stacked together.
166
166
We 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
167
167
See [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
168
+
Use the `svgs` prop to pass in `react-native-svg` compliant props to each area.
168
169
169
170

@@ -307,15 +316,19 @@ Also supports all [Common arguments to children](#common-arguments-to-children)
307
316
308
317
### StackedBarChart
309
318
310
-
The same as the [StackedAreaChart](#stackedareachart) except with bars.
319
+
The same as the [StackedAreaChart](#stackedareachart) except with bars (and different `svgs` prop).
311
320
We 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
312
321
322
+
The `svgs` prop here is not based on keys, but rather entries, as the user might want to specify different props
323
+
for 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
324
+
325
+
313
326

314
327

@@ -378,9 +391,10 @@ class StackedBarChartExample extends React.PureComponent {
378
391
379
392
| Property | Default | Description |
380
393
| --- | --- | --- |
381
-
| data |**required**| An array of the data entries|
394
+
| data |**required**| An array of the data entries: each value can be a number or a complex object with custom `svg` props for example|
382
395
| keys | **required** | This array should contain the object keys of interest (see above example)
383
396
| colors |**required**| An array of equal size as `keys` with the color for each key |
397
+
| valueAccessor | ({ item, key }) => item[key]| Very similar to the `yAccessor` of the other charts, usually needed when using complex objects as values |
384
398
| horizontal | false | Boolean whether or not the bars should be horizontal |
385
399
| order |[d3.stackOrderNone](https://github.com/d3/d3-shape#stackOrderNone)| The order in which to sort the areas |
386
400
| offset |[d3.stackOffsetNone](https://github.com/d3/d3-shape#stackOffsetNone)| A function to determine the offset of the areas |
@@ -407,7 +421,7 @@ when trying to layout decorators. It does however call with the rest of the [com
@@ -493,6 +508,8 @@ class PieChartExample extends React.PureComponent {
493
508
| innerRadius | "50%" | The inner radius, use this to create a donut. Takes either percentages or absolute numbers (pixels) |
494
509
| labelRadius | undefined | The radius of the circle that will help you layout your labels. Takes either percentages or absolute numbers (pixels) |
495
510
| padAngle || The angle between the slices |
511
+
| startAngle | 0 | The start angle in radians of the entire pie |
512
+
| endAngle | Math.PI * 2 | The end angle in radians of the entire pie |
496
513
| 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 |
497
514
498
515
#### Arguments to children
@@ -509,7 +526,8 @@ class PieChartExample extends React.PureComponent {
0 commit comments