Error thrown when set `data` is an empty list in <LineChart />
vdamrongsri opened this issue · comments
Van Damrongsri commented
Code
<LineChart
bezier
fromZero
withVerticalLabels
withDots={false}
withInnerLines={false}
withOuterLines={false}
withHorizontalLabels={false}
data={{
labels: ['Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat'],
datasets: [
{
data: [], <---- data set to empty array
color: () => '#FF4F4F',
strokeWidth: 2
},
]
}}
...
Error thrown
InvalidNumber: M0,0 L-Infinity, 118 L10, 118 Z
Potential related to
_this.getBezierLinePoints = function (dataset, _a) {
var width = _a.width, height = _a.height, paddingRight = _a.paddingRight, paddingTop = _a.paddingTop, data = _a.data;
if (dataset.data.length === 0) {
return "M0,0"; <--- this return value
}