Skip to content

Commit

Permalink
fix(line): fix line chart color when animation disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte committed Aug 8, 2017
1 parent 7fc0e4d commit 41e9e25
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/lib/charts/line/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,21 @@ export const generateLines = (data, width, height, color) => {
const xScale = getXScale(data, width)
const yScale = getYScale(data, height)

const lines = data.map(({ id, data: serie }) => ({
id,
color: color(id),
points: serie.map(d =>
Object.assign({}, d, {
value: d.y,
x: xScale(d.x),
y: yScale(d.y),
})
),
}))
const lines = data.map(serie => {
const { id, data: serieData } = serie

return {
id,
color: color(serie),
points: serieData.map(d =>
Object.assign({}, d, {
value: d.y,
x: xScale(d.x),
y: yScale(d.y),
})
),
}
})

return { xScale, yScale, lines }
}
Expand Down

0 comments on commit 41e9e25

Please sign in to comment.