Fix bullet chart rendering (#5108)

* Fix bullet chart rendering

* Fix code style errors
This commit is contained in:
Tresdon Jones 2018-06-11 17:40:29 -06:00 committed by Maxime Beauchemin
parent a3477abf7e
commit 3de79b69d0
1 changed files with 7 additions and 3 deletions

View File

@ -118,9 +118,13 @@ export default function nvd3Vis(slice, payload) {
let data;
if (payload.data) {
data = payload.data.map(x => ({
...x, key: formatLabel(x.key, slice.datasource.verbose_map),
}));
if (Array.isArray(payload.data)) {
data = payload.data.map(x => ({
...x, key: formatLabel(x.key, slice.datasource.verbose_map),
}));
} else {
data = payload.data;
}
} else {
data = [];
}