Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/data/SeriesData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ class SeriesData<
const invertedIndicesMap = data._invertedIndicesMap;
zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {
const dimInfo = data._dimInfos[dim];
// Currently, only dimensions that has ordinalMeta can create inverted indices.
// Currently, only dimensions that have ordinalMeta or are of type time can create inverted indices.
const ordinalMeta = dimInfo.ordinalMeta;
const store = data._store;
if (ordinalMeta) {
Expand All @@ -1408,6 +1408,13 @@ class SeriesData<
invertedIndices[store.get(dimInfo.storeDimIndex, i) as number] = i;
}
}
else if (dimInfo.type === 'time') {
invertedIndices = invertedIndicesMap[dim] = { length: store.count() };
for (let i = 0; i < store.count(); i++) {
// Only support the case that all values are distinct.
invertedIndices[store.get(dimInfo.storeDimIndex, i) as number] = i;
}
}
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/data/helper/dataStackHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function enableDataStack(

if (mayStack && !dimensionInfo.isExtraCoord) {
// Find the first ordinal dimension as the stackedByDimInfo.
if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {
if (!byIndex && !stackedByDimInfo && (dimensionInfo.ordinalMeta || dimensionInfo.type === 'time')) {
stackedByDimInfo = dimensionInfo;
}
// Find the first stackable dimension as the stackedDimInfo.
Expand Down
121 changes: 121 additions & 0 deletions test/line-stack-disjunct-timeseries.html

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