tvcharts 0.7.41 → 0.7.43
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/chart/boxes/BoxesLayout.js +1 -1
- package/lib/chart/fills/FillsView.js +2 -1
- package/lib/chart/labels/labelsLayout.js +2 -1
- package/lib/chart/linesPlot/LinesPlotView.js +4 -2
- package/lib/chart/mineLines/util.js +1 -1
- package/lib/core/echarts.js +9 -19
- package/lib/data/scale-time/default-tick-mark-formatter.js +5 -2
- package/lib/data/scale-time/time-scale-point-weight-generator.js +10 -11
- package/package.json +1 -1
- package/types/src/data/scale-time/default-tick-mark-formatter.d.ts +1 -1
|
@@ -166,7 +166,7 @@ var BoxesLayout = {
|
|
|
166
166
|
var width_1 = Math.abs(endPoint[0] - startPoint[0]);
|
|
167
167
|
var height = Math.abs(endPoint[1] - startPoint[1]);
|
|
168
168
|
var minBoxSize = Math.min(width_1, height);
|
|
169
|
-
if (!minBoxSize) {
|
|
169
|
+
if (!minBoxSize && text_size === 'auto') {
|
|
170
170
|
continue;
|
|
171
171
|
}
|
|
172
172
|
var _c = getBoxPoint(startPoint, endPoint, text_halign, text_valign),
|
|
@@ -207,8 +207,9 @@ var labelsLayout = {
|
|
|
207
207
|
if (location === 'top') {
|
|
208
208
|
symbolPoint[1] = symbolPoint[1] + symbolRect[1];
|
|
209
209
|
}
|
|
210
|
+
var ylocIsBottom = yloc ? yloc === 'belowbar' || yloc === 'price' : true;
|
|
210
211
|
// y轴位置靠下时
|
|
211
|
-
if (
|
|
212
|
+
if (ylocIsBottom && upSymbols.includes(symbol)) {
|
|
212
213
|
symbolPoint[1] = symbolPoint[1] + symbolRect[1];
|
|
213
214
|
}
|
|
214
215
|
// 为居中label时特殊处理
|
|
@@ -279,7 +279,8 @@ var LinesPlotView = /** @class */function (_super) {
|
|
|
279
279
|
style: {
|
|
280
280
|
lineDash: lineDash,
|
|
281
281
|
stroke: visualColor_1 || color,
|
|
282
|
-
lineWidth: +lineWidth
|
|
282
|
+
lineWidth: +lineWidth,
|
|
283
|
+
lineJoin: 'round'
|
|
283
284
|
},
|
|
284
285
|
z2: isDefaultColor ? LastZ2 : z2_1
|
|
285
286
|
});
|
|
@@ -318,7 +319,8 @@ var LinesPlotView = /** @class */function (_super) {
|
|
|
318
319
|
},
|
|
319
320
|
style: {
|
|
320
321
|
stroke: 'none',
|
|
321
|
-
fill: visualColor_2 || color
|
|
322
|
+
fill: visualColor_2 || color,
|
|
323
|
+
lineJoin: 'round'
|
|
322
324
|
},
|
|
323
325
|
z2: isDefaultColor ? LastZ2 : z2_2
|
|
324
326
|
});
|
|
@@ -58,7 +58,7 @@ function getArrowPoints(fromX, fromY, toX, toY, arrowAngle) {
|
|
|
58
58
|
if (length <= 20) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
var arrowLength = Math.min(Math.floor(length / 3),
|
|
61
|
+
var arrowLength = Math.min(Math.floor(length / 3), 10);
|
|
62
62
|
// 计算单位方向向量
|
|
63
63
|
var normalizedDirectionX = dx / length;
|
|
64
64
|
var normalizedDirectionY = dy / length;
|
package/lib/core/echarts.js
CHANGED
|
@@ -1009,7 +1009,7 @@ var ECharts = /** @class */function (_super) {
|
|
|
1009
1009
|
});
|
|
1010
1010
|
// Extra events
|
|
1011
1011
|
// TODO register?
|
|
1012
|
-
each(['selectchanged', 'selectitem', 'loadmore', 'zoomend', 'visiblechanged'], function (eventType) {
|
|
1012
|
+
each(['selectchanged', 'selectitem', 'loadmore', 'zoomend', 'visiblechanged', 'dataappend'], function (eventType) {
|
|
1013
1013
|
_this._messageCenter.on(eventType, function (event) {
|
|
1014
1014
|
this.trigger(eventType, event);
|
|
1015
1015
|
}, _this);
|
|
@@ -1418,27 +1418,17 @@ var ECharts = /** @class */function (_super) {
|
|
|
1418
1418
|
updateMethods.update.call(chart, isAdd ? {
|
|
1419
1419
|
type: 'dataZoom'
|
|
1420
1420
|
} : void 0);
|
|
1421
|
+
if (isAdd) {
|
|
1422
|
+
chart._messageCenter.trigger('dataappend');
|
|
1423
|
+
}
|
|
1421
1424
|
});
|
|
1422
1425
|
} else {
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
// if (isAdd && lastTime !== time) {
|
|
1429
|
-
// ordinalMeta.appendData([time]);
|
|
1430
|
-
// }
|
|
1431
|
-
if (isMove) {
|
|
1432
|
-
var payload = {
|
|
1433
|
-
type: 'dataZoom',
|
|
1434
|
-
barSpace: scale.barSpace,
|
|
1435
|
-
lastBarRightSideDiffBarCount: scale.lastBarRightSideDiffBarCount - 1,
|
|
1436
|
-
isPushSync: true
|
|
1437
|
-
};
|
|
1438
|
-
doDispatchAction.call(this, payload, false);
|
|
1439
|
-
return;
|
|
1426
|
+
updateMethods.update.call(this, isAdd ? {
|
|
1427
|
+
type: 'dataZoom'
|
|
1428
|
+
} : void 0);
|
|
1429
|
+
if (isAdd) {
|
|
1430
|
+
this._messageCenter.trigger('dataappend');
|
|
1440
1431
|
}
|
|
1441
|
-
updateMethods.update.call(this);
|
|
1442
1432
|
}
|
|
1443
1433
|
};
|
|
1444
1434
|
ECharts.prototype.scrollByDistance = function (distance, animationDuration) {
|
|
@@ -45,9 +45,12 @@ export function weightToTickMarkType(weight, timeVisible, secondsVisible) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export function defaultTickMarkFormatter(timePoint, tickMarkType, locale) {
|
|
48
|
+
export function defaultTickMarkFormatter(timePoint, tickMarkType, locale, timeZone) {
|
|
49
|
+
if (timeZone === void 0) {
|
|
50
|
+
timeZone = 'Asia/Shanghai';
|
|
51
|
+
}
|
|
49
52
|
var formatOptions = {
|
|
50
|
-
timeZone:
|
|
53
|
+
timeZone: timeZone
|
|
51
54
|
};
|
|
52
55
|
switch (tickMarkType) {
|
|
53
56
|
case 0 /* Year */:
|
|
@@ -59,23 +59,22 @@ var intradayWeightDivisors = [{
|
|
|
59
59
|
}];
|
|
60
60
|
// 服务端转换了本地时间 先用本地时间处理
|
|
61
61
|
function weightByTime(currentDate, prevDate) {
|
|
62
|
-
|
|
62
|
+
if (currentDate.getUTCFullYear() !== prevDate.getUTCFullYear()) {
|
|
63
|
+
return 70 /* Year */;
|
|
64
|
+
} else if (currentDate.getUTCMonth() !== prevDate.getUTCMonth()) {
|
|
65
|
+
return 60 /* Month */;
|
|
66
|
+
} else if (currentDate.getUTCDate() !== prevDate.getUTCDate()) {
|
|
67
|
+
return 50 /* Day */;
|
|
68
|
+
}
|
|
69
|
+
// if (currentDate.getFullYear() !== prevDate.getFullYear()) {
|
|
63
70
|
// return TickMarkWeight.Year;
|
|
64
71
|
// }
|
|
65
|
-
// else if (currentDate.
|
|
72
|
+
// else if (currentDate.getMonth() !== prevDate.getMonth()) {
|
|
66
73
|
// return TickMarkWeight.Month;
|
|
67
74
|
// }
|
|
68
|
-
// else if (currentDate.
|
|
75
|
+
// else if (currentDate.getDate() !== prevDate.getDate()) {
|
|
69
76
|
// return TickMarkWeight.Day;
|
|
70
77
|
// }
|
|
71
|
-
if (currentDate.getFullYear() !== prevDate.getFullYear()) {
|
|
72
|
-
return 70 /* Year */;
|
|
73
|
-
} else if (currentDate.getMonth() !== prevDate.getMonth()) {
|
|
74
|
-
return 60 /* Month */;
|
|
75
|
-
} else if (currentDate.getDate() !== prevDate.getDate()) {
|
|
76
|
-
return 50 /* Day */;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
78
|
for (var i = intradayWeightDivisors.length - 1; i >= 0; --i) {
|
|
80
79
|
if (Math.floor(prevDate.getTime() / intradayWeightDivisors[i].divisor) !== Math.floor(currentDate.getTime() / intradayWeightDivisors[i].divisor)) {
|
|
81
80
|
return intradayWeightDivisors[i].weight;
|
package/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TickMarkType, TimePoint, TickMarkWeight } from './types.js';
|
|
2
2
|
export declare function weightToTickMarkType(weight: TickMarkWeight, timeVisible: boolean, secondsVisible: boolean): TickMarkType;
|
|
3
|
-
export declare function defaultTickMarkFormatter(timePoint: TimePoint, tickMarkType: TickMarkType, locale: string): string;
|
|
3
|
+
export declare function defaultTickMarkFormatter(timePoint: TimePoint, tickMarkType: TickMarkType, locale: string, timeZone?: string): string;
|