fix: preprocess rect attributes before creating bar

This commit is contained in:
Shivam Mishra 2020-07-08 21:18:38 +05:30
parent 773f93c414
commit 222cbb686f

View File

@ -505,6 +505,12 @@ export function datasetBar(x, yTop, width, color, label='', index=0, offset=0, m
y -= meta.minHeight;
}
// Preprocess numbers to avoid svg building errors
if (!isValidNumber(x)) x = 0;
if (!isValidNumber(y)) y = 0;
if (!isValidNumber(height, true)) height = 0;
if (!isValidNumber(width, true)) width = 0;
let rect = createSVG('rect', {
className: `bar mini`,
style: `fill: ${color}`,