Skip to content

Commit

Permalink
don't render points based on keys, but rather based on data points (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperLekland authored Feb 1, 2018
1 parent bd6f30a commit 3292dd5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stacked-area-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class AreaStack extends PureComponent {
.range([ height - bottom, top ])

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

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

return {
path,
Expand Down Expand Up @@ -140,7 +140,7 @@ class AreaStack extends PureComponent {
)
) }
{ series.map((serie) => {
return keys.map((key, index) => {
return data.map((key, index) => {
return renderDecorator({ x, y, index, value: serie[ index ][ 1 ] })
})
}) }
Expand Down

0 comments on commit 3292dd5

Please sign in to comment.