Skip to content

Commit fbcd7db

Browse files
2.2.2 (#39)
* don't render points based on keys, but rather based on data points (#38) * 2.2.2
1 parent bd6f30a commit fbcd7db

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-svg-charts",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"private": false,
55
"description": "Customizable charts (Line, Bar, Area, Pie, Circle, Waterfall, Progress) for React Native",
66
"main": "src/index.js",

src/stacked-area-chart.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class AreaStack extends PureComponent {
8484
.range([ height - bottom, top ])
8585

8686
const x = scale.scaleLinear()
87-
.domain([ 0, keys.length - 1 ])
87+
.domain([ 0, data.length - 1 ])
8888
.range([ left, width - right ])
8989

9090
const areas = series.map((serie, index) => {
@@ -93,7 +93,7 @@ class AreaStack extends PureComponent {
9393
.y0(d => y(d[ 0 ]))
9494
.y1(d => y(d[ 1 ]))
9595
.curve(curve)
96-
(keys.map((_, index) => serie[ index ]))
96+
(data.map((_, index) => serie[ index ]))
9797

9898
return {
9999
path,
@@ -140,7 +140,7 @@ class AreaStack extends PureComponent {
140140
)
141141
) }
142142
{ series.map((serie) => {
143-
return keys.map((key, index) => {
143+
return data.map((key, index) => {
144144
return renderDecorator({ x, y, index, value: serie[ index ][ 1 ] })
145145
})
146146
}) }

0 commit comments

Comments
 (0)