Newer
Older
diff --git a/node_modules/echarts/lib/chart/line/helper.js b/node_modules/echarts/lib/chart/line/helper.js
index fa02e2f..cc3cb7d 100644
--- a/node_modules/echarts/lib/chart/line/helper.js
+++ b/node_modules/echarts/lib/chart/line/helper.js
@@ -108,16 +108,18 @@ function getValueStart(valueAxis, valueOrigin) {
return valueStart;
}
export function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {
- var value = NaN;
+ let stackedOverValue = NaN;
+ let stackResultValue = NaN;
if (dataCoordInfo.stacked) {
- value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);
- }
- if (isNaN(value)) {
- value = dataCoordInfo.valueStart;
+ stackedOverValue = data.get(data.getCalculationInfo('stackedOverDimension'), idx);
+ stackResultValue = data.get(data.getCalculationInfo('stackResultDimension'), idx);
}
+ if (isNaN(stackedOverValue) && !(dataCoordInfo.stacked && isNaN(stackResultValue))) {
+ stackedOverValue = dataCoordInfo.valueStart;
+}
var baseDataOffset = dataCoordInfo.baseDataOffset;
var stackedData = [];
stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);
- stackedData[1 - baseDataOffset] = value;
+ stackedData[1 - baseDataOffset] = stackedOverValue;
return coordSys.dataToPoint(stackedData);
}
\ No newline at end of file
diff --git a/node_modules/echarts/lib/data/helper/dataStackHelper.js b/node_modules/echarts/lib/data/helper/dataStackHelper.js
index c25de1b..a3ced22 100644
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--- a/node_modules/echarts/lib/data/helper/dataStackHelper.js
+++ b/node_modules/echarts/lib/data/helper/dataStackHelper.js
@@ -83,6 +83,13 @@ export function enableDataStack(seriesModel, dimensionsInput, opt) {
var stackedDimInfo;
var stackResultDimension;
var stackedOverDimension;
+
+ var yCoordDimension = dimensionDefineList.find(
+ dimensionInfo => !isString(dimensionInfo) && dimensionInfo.coordDim === 'y'
+ );
+ var isYCoordDimensionStackable = yCoordDimension != null
+ && yCoordDimension.type !== 'ordinal' && yCoordDimension.type !== 'time';
+
each(dimensionDefineList, function (dimensionInfo, index) {
if (isString(dimensionInfo)) {
dimensionDefineList[index] = dimensionInfo = {
@@ -95,7 +102,10 @@ export function enableDataStack(seriesModel, dimensionsInput, opt) {
stackedByDimInfo = dimensionInfo;
}
// Find the first stackable dimension as the stackedDimInfo.
- if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {
+ if (!stackedDimInfo && dimensionInfo.type !== 'ordinal'
+ && dimensionInfo.type !== 'time'
+ && (yCoordDimension == null || (dimensionInfo.coordDim !== 'x' && isYCoordDimensionStackable))
+ && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {
stackedDimInfo = dimensionInfo;
}
}
@@ -105,6 +115,11 @@ export function enableDataStack(seriesModel, dimensionsInput, opt) {
// It may make sense if the user provides elaborately constructed data.
byIndex = true;
}
+ if (stackedDimInfo && !byIndex && !stackedByDimInfo) {
+ // Compatible with previous design, value axis (time axis) only stack by index.
+ // It may make sense if the user provides elaborately constructed data.
+ byIndex = true;
+ }
// Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.
// That put stack logic in List is for using conveniently in echarts extensions, but it
// might not be a good way.
diff --git a/node_modules/echarts/lib/label/labelLayoutHelper.js b/node_modules/echarts/lib/label/labelLayoutHelper.js
index a75f606..57bec85 100644
--- a/node_modules/echarts/lib/label/labelLayoutHelper.js
+++ b/node_modules/echarts/lib/label/labelLayoutHelper.js
@@ -256,6 +256,13 @@ export function hideOverlap(labelList) {
var transform = labelItem.transform;
var label = labelItem.label;
var labelLine = labelItem.labelLine;
+
+ if (label.style.text === "") {
+ hideEl(label);
+ labelLine && hideEl(labelLine);
+ continue;
+ }
+
globalRect.copy(labelItem.rect);
// Add a threshold because layout may be aligned precisely.
globalRect.width -= 0.1;