Skip to content

Commit

Permalink
Merge pull request #18276 from susiwen8/18050
Browse files Browse the repository at this point in the history
fix(dataset): object source contains `length` breaks render
  • Loading branch information
Ovilia authored Feb 16, 2023
2 parents fc2be18 + da29a8d commit 9191ab2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/data/Source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import {
isTypedArray, HashMap, clone, createHashMap, isArray, isObject, isArrayLike,
hasOwn, assert, each, map, isNumber, isString
hasOwn, assert, each, map, isNumber, isString, keys
} from 'zrender/src/core/util';
import {
SourceFormat, SeriesLayoutBy, DimensionDefinition,
Expand Down Expand Up @@ -405,11 +405,7 @@ function objectRowsCollectDimensions(data: OptionSourceDataObjectRows): Dimensio
let obj;
while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line
if (obj) {
const dimensions: DimensionDefinitionLoose[] = [];
each(obj, function (value, key) {
dimensions.push(key);
});
return dimensions;
return keys(obj);
}
}

Expand Down
39 changes: 39 additions & 0 deletions test/dataset-category.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9191ab2

Please sign in to comment.