tvcharts 0.8.62 → 0.8.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/echarts.js +7 -6
- package/package.json +1 -1
package/lib/core/echarts.js
CHANGED
|
@@ -1195,19 +1195,20 @@ var ECharts = /** @class */function (_super) {
|
|
|
1195
1195
|
endIndex = _a[1];
|
|
1196
1196
|
var axisLength = xAxisModal.axis.getExtent()[1];
|
|
1197
1197
|
var width = axisLength - offsetRightDistance - offsetLeftDistance;
|
|
1198
|
-
var barCount = endIndex - startIndex;
|
|
1198
|
+
var barCount = Math.max(endIndex - startIndex, 2);
|
|
1199
1199
|
var barSpace = Math.max(1, width / barCount);
|
|
1200
1200
|
var lastBarRightSideDiffBarCount = endIndex - dataCount + 0.5 + offsetRightDistance / barSpace;
|
|
1201
1201
|
if (endIndex < 0) {
|
|
1202
1202
|
barCount = dataCount;
|
|
1203
1203
|
barSpace = Math.max(1, axisLength / barCount);
|
|
1204
1204
|
lastBarRightSideDiffBarCount = endIndex - dataCount + 0.5;
|
|
1205
|
-
} else if (barCount < 2) {
|
|
1206
|
-
barCount = 2;
|
|
1207
|
-
barSpace = Math.max(1, axisLength / barCount);
|
|
1208
|
-
lastBarRightSideDiffBarCount = endIndex - dataCount + 0.5;
|
|
1209
1205
|
}
|
|
1210
|
-
|
|
1206
|
+
// else if (barCount < 2) {
|
|
1207
|
+
// barCount = 2;
|
|
1208
|
+
// barSpace = Math.max(1, axisLength / barCount);
|
|
1209
|
+
// lastBarRightSideDiffBarCount = endIndex - dataCount + 0.5;
|
|
1210
|
+
// }
|
|
1211
|
+
var maxRightOffsetBarCount = axisLength / barSpace - Math.min(2, dataCount);
|
|
1211
1212
|
if (lastBarRightSideDiffBarCount > maxRightOffsetBarCount) {
|
|
1212
1213
|
lastBarRightSideDiffBarCount = maxRightOffsetBarCount;
|
|
1213
1214
|
}
|