Skip to content
This repository has been archived by the owner on Jun 14, 2019. It is now read-only.

Commit

Permalink
Fix for drawing end line on line chart
Browse files Browse the repository at this point in the history
  • Loading branch information
aleib committed Jul 4, 2018
1 parent 99163ca commit 09adaec
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/util/MultiLineUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,19 @@ export const getComposedData = (chartProps, type, xAxis, yAxis, dataKey,
});
}

const lastItem = data[data.length - 1]
data.push({
x: layout === 'horizontal' ?
lastItem.x + bandSize :
lastItem.x,
y: layout === 'horizontal' ?
lastItem.y :
lastItem.y + bandSize,
value: lastItem.value,
nullVals: lastItem.nullVals
});
if (endIndex < dataEndIndex) {
const lastItem = data[data.length - 1]
data.push({
x: layout === 'horizontal' ?
lastItem.x + bandSize :
lastItem.x,
y: layout === 'horizontal' ?
lastItem.y :
lastItem.y + bandSize,
value: lastItem.value,
nullVals: lastItem.nullVals
});
}

return data;
};
Expand Down

0 comments on commit 09adaec

Please sign in to comment.