From 6c091a46e3cc7599b1207f214bf0b55d079b6ea2 Mon Sep 17 00:00:00 2001 From: Alex L Date: Fri, 4 Aug 2017 11:38:52 +0200 Subject: [PATCH] Step chart fix --- src/util/MultiLineUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/MultiLineUtils.js b/src/util/MultiLineUtils.js index 4150eba455..6ff1835a9d 100644 --- a/src/util/MultiLineUtils.js +++ b/src/util/MultiLineUtils.js @@ -33,7 +33,7 @@ export const getComposedData = (chartProps, type, xAxis, yAxis, dataKey, for (var i = startIndex; i <= endIndex; i++) { const dataPoint = chartProps.data[i]; const value = _.get(dataPoint, dataKey, null) - const extend = i === endIndex && (type === 'stepAfter' || value === null) + const extend = i === endIndex && startIndex !== endIndex && (type === 'stepAfter' || value === null) const yDataPoint = extend ? chartProps.data[i - 1] : chartProps.data[i]; const prevYPointWasNull = i === startIndex || _.get(chartProps.data[i - 1], dataKey, null) === null