jmchart 1.1.81 → 1.1.90
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/README.md +30 -28
- package/build.js +35 -35
- package/dist/jmchart.amd.js +680 -423
- package/dist/jmchart.cjs.js +678 -421
- package/dist/jmchart.esm.js +677 -420
- package/dist/jmchart.iife.js +679 -422
- package/dist/jmchart.system.js +682 -425
- package/example/bar.html +180 -180
- package/example/candlestick.html +288 -0
- package/example/index.html +294 -0
- package/example/js/vconsole.js +10 -0
- package/example/line.html +300 -297
- package/example/pie.html +353 -353
- package/example/stackBar.html +142 -142
- package/example/stackLine.html +147 -147
- package/example/test.html +40 -40
- package/example/vue.html +322 -322
- package/example/wk/line.html +314 -314
- package/index.js +8 -8
- package/package.json +42 -42
- package/rollup.config.js +26 -26
- package/server.js +45 -45
- package/src/common/style.js +259 -242
- package/src/common/tooltip.js +165 -165
- package/src/common/utils.js +21 -21
- package/src/component/vchart.js +130 -130
- package/src/core/axis/axis.js +622 -622
- package/src/core/legend/legend.js +163 -163
- package/src/core/markLine/manager.js +152 -0
- package/src/core/{axis → markLine}/markLine.js +190 -190
- package/src/jmChart.js +416 -464
- package/src/series/barSeries.js +135 -135
- package/src/series/candlestickSeries.js +114 -0
- package/src/series/lineSeries.js +243 -243
- package/src/series/pieSeries.js +350 -350
- package/src/series/series.js +397 -396
- package/src/series/stackBarSeries.js +144 -144
- package/src/series/stackLineSeries.js +145 -145
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
import {
|
|
2
|
-
jmRect
|
|
3
|
-
} from 'jmgraph';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 图例的容器
|
|
7
|
-
*
|
|
8
|
-
* @class jmLegend
|
|
9
|
-
* @module jmChart
|
|
10
|
-
* @param {jmChart} chart 当前图表
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export default class jmLegend extends jmRect {
|
|
14
|
-
|
|
15
|
-
constructor(options) {
|
|
16
|
-
//当前图例位置偏移量
|
|
17
|
-
options.position = options.position || {
|
|
18
|
-
x: 0,
|
|
19
|
-
y: 0
|
|
20
|
-
};
|
|
21
|
-
super(options);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 图例放置位置
|
|
26
|
-
*/
|
|
27
|
-
legendPosition = '
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 添加图例
|
|
32
|
-
*
|
|
33
|
-
* @method append
|
|
34
|
-
* @param {jmSeries} series 当前图序列
|
|
35
|
-
* @param {jmControl} shape 当前图例的图形对象
|
|
36
|
-
*/
|
|
37
|
-
jmLegend.prototype.append = function(series, shape, options = {}) {
|
|
38
|
-
// 如果不显示图例,就不处理
|
|
39
|
-
if(this.visible === false) return;
|
|
40
|
-
|
|
41
|
-
const panel = this.graph.createShape('rect',{
|
|
42
|
-
style: this.graph.utils.clone(this.style.item),
|
|
43
|
-
position: {
|
|
44
|
-
x: 0,
|
|
45
|
-
y: 0
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
this.children.add(panel);
|
|
50
|
-
panel.children.add(shape);
|
|
51
|
-
|
|
52
|
-
shape.width = panel.style.shape.width;
|
|
53
|
-
shape.height = panel.style.shape.height;
|
|
54
|
-
|
|
55
|
-
let name = options.name || series.legendLabel;
|
|
56
|
-
name = series.option.legendFormat? series.option.legendFormat.call(series, options): name;
|
|
57
|
-
|
|
58
|
-
if(name) {
|
|
59
|
-
//生成图例名称
|
|
60
|
-
const label = this.graph.createShape('label', {
|
|
61
|
-
style: panel.style.label,
|
|
62
|
-
text: name || ''
|
|
63
|
-
});
|
|
64
|
-
label.height = shape.height;
|
|
65
|
-
label.position = {x: shape.width + 4, y: 0};
|
|
66
|
-
panel.children.add(label);
|
|
67
|
-
|
|
68
|
-
panel.width = shape.width + label.testSize().width;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
panel.width = shape.width;
|
|
72
|
-
}
|
|
73
|
-
panel.height = shape.height;
|
|
74
|
-
|
|
75
|
-
//执行进入事件
|
|
76
|
-
//触动图例后加粗显示图
|
|
77
|
-
/*const hover = options.hover || function() {
|
|
78
|
-
//应用图的动态样式
|
|
79
|
-
//Object.assign(series.style, series.style.hover);
|
|
80
|
-
|
|
81
|
-
//Object.assign(this.style, this.style.hover || {});
|
|
82
|
-
|
|
83
|
-
//series.graph.refresh();
|
|
84
|
-
};
|
|
85
|
-
panel.bind('mouseover', hover);
|
|
86
|
-
//执行离开
|
|
87
|
-
const leave = options.leave || function() {
|
|
88
|
-
//应用图的普通样式
|
|
89
|
-
//Object.assign(series.style, series.style.normal);
|
|
90
|
-
|
|
91
|
-
//Object.assign(this.style, this.style.normal || {});
|
|
92
|
-
//jmUtils.apply(this.series.style.normal,this.series.style);
|
|
93
|
-
//series.graph.refresh();
|
|
94
|
-
};
|
|
95
|
-
panel.bind('mouseleave', leave);*/
|
|
96
|
-
|
|
97
|
-
const legendPosition = this.legendPosition || this.style.legendPosition;
|
|
98
|
-
if(legendPosition == 'top' || legendPosition == 'bottom') {
|
|
99
|
-
//顶部和底部图例横排,每次右移位一个单位图例
|
|
100
|
-
panel.position.x = this.width + 15 * this.graph.devicePixelRatio;
|
|
101
|
-
this.width = panel.position.x + panel.width; // 把容器宽指定为所有图例宽和
|
|
102
|
-
this.height = Math.max(panel.height, this.height);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
//右边和左边图例竖排
|
|
106
|
-
panel.position.y += this.height + 5 * this.graph.devicePixelRatio;
|
|
107
|
-
this.height = panel.position.y + panel.height;
|
|
108
|
-
this.width = Math.max(panel.width, this.width);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
this.needUpdate = true;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* 初始化图例
|
|
116
|
-
*
|
|
117
|
-
* @method init
|
|
118
|
-
*/
|
|
119
|
-
jmLegend.prototype.init = function() {
|
|
120
|
-
this.position.x = 0;
|
|
121
|
-
this.position.y = 0;
|
|
122
|
-
this.width = 0;
|
|
123
|
-
this.height = 0;
|
|
124
|
-
this.style.lineWidth = 0;
|
|
125
|
-
this.children.clear();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* 重置图例属性,根据图例内容计算期大小并更新画图区域大小
|
|
130
|
-
*
|
|
131
|
-
* @method reset
|
|
132
|
-
*/
|
|
133
|
-
jmLegend.prototype.reset = function() {
|
|
134
|
-
|
|
135
|
-
if(this.visible !== false) {
|
|
136
|
-
this.position.x = this.graph.chartArea.position.x;
|
|
137
|
-
this.position.y = this.graph.chartArea.position.y;
|
|
138
|
-
var legendPosition = this.legendPosition || this.style.legendPosition;
|
|
139
|
-
switch(legendPosition) {
|
|
140
|
-
case 'left': {
|
|
141
|
-
this.graph.chartArea.width = this.graph.chartArea.width - this.width;
|
|
142
|
-
//画图区域向右偏移
|
|
143
|
-
this.graph.chartArea.position.x = this.position.x + this.width + this.style.margin.right * this.graph.devicePixelRatio;
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
case 'top': {
|
|
147
|
-
this.graph.chartArea.height = this.graph.chartArea.height - this.height;
|
|
148
|
-
this.graph.chartArea.position.y = this.position.y + this.height + this.style.margin.bottom * this.graph.devicePixelRatio;
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
case 'bottom': {
|
|
152
|
-
this.graph.chartArea.height = this.graph.chartArea.height - this.height;
|
|
153
|
-
this.position.y = this.graph.chartArea.position.y + this.graph.chartArea.height + this.style.margin.top * this.graph.devicePixelRatio;
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
case 'right':
|
|
157
|
-
default: {
|
|
158
|
-
this.graph.chartArea.width = this.graph.chartArea.width - this.width;
|
|
159
|
-
this.position.x = this.graph.chartArea.position.x + this.graph.chartArea.width + this.style.margin.left * this.graph.devicePixelRatio;
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
jmRect
|
|
3
|
+
} from 'jmgraph';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 图例的容器
|
|
7
|
+
*
|
|
8
|
+
* @class jmLegend
|
|
9
|
+
* @module jmChart
|
|
10
|
+
* @param {jmChart} chart 当前图表
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default class jmLegend extends jmRect {
|
|
14
|
+
|
|
15
|
+
constructor(options) {
|
|
16
|
+
//当前图例位置偏移量
|
|
17
|
+
options.position = options.position || {
|
|
18
|
+
x: 0,
|
|
19
|
+
y: 0
|
|
20
|
+
};
|
|
21
|
+
super(options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 图例放置位置
|
|
26
|
+
*/
|
|
27
|
+
legendPosition = '';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 添加图例
|
|
32
|
+
*
|
|
33
|
+
* @method append
|
|
34
|
+
* @param {jmSeries} series 当前图序列
|
|
35
|
+
* @param {jmControl} shape 当前图例的图形对象
|
|
36
|
+
*/
|
|
37
|
+
jmLegend.prototype.append = function(series, shape, options = {}) {
|
|
38
|
+
// 如果不显示图例,就不处理
|
|
39
|
+
if(this.visible === false) return;
|
|
40
|
+
|
|
41
|
+
const panel = this.graph.createShape('rect',{
|
|
42
|
+
style: this.graph.utils.clone(this.style.item),
|
|
43
|
+
position: {
|
|
44
|
+
x: 0,
|
|
45
|
+
y: 0
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
this.children.add(panel);
|
|
50
|
+
panel.children.add(shape);
|
|
51
|
+
|
|
52
|
+
shape.width = panel.style.shape.width;
|
|
53
|
+
shape.height = panel.style.shape.height;
|
|
54
|
+
|
|
55
|
+
let name = options.name || series.legendLabel;
|
|
56
|
+
name = series.option.legendFormat? series.option.legendFormat.call(series, options): name;
|
|
57
|
+
|
|
58
|
+
if(name) {
|
|
59
|
+
//生成图例名称
|
|
60
|
+
const label = this.graph.createShape('label', {
|
|
61
|
+
style: panel.style.label,
|
|
62
|
+
text: name || ''
|
|
63
|
+
});
|
|
64
|
+
label.height = shape.height;
|
|
65
|
+
label.position = {x: shape.width + 4, y: 0};
|
|
66
|
+
panel.children.add(label);
|
|
67
|
+
|
|
68
|
+
panel.width = shape.width + label.testSize().width;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
panel.width = shape.width;
|
|
72
|
+
}
|
|
73
|
+
panel.height = shape.height;
|
|
74
|
+
|
|
75
|
+
//执行进入事件
|
|
76
|
+
//触动图例后加粗显示图
|
|
77
|
+
/*const hover = options.hover || function() {
|
|
78
|
+
//应用图的动态样式
|
|
79
|
+
//Object.assign(series.style, series.style.hover);
|
|
80
|
+
|
|
81
|
+
//Object.assign(this.style, this.style.hover || {});
|
|
82
|
+
|
|
83
|
+
//series.graph.refresh();
|
|
84
|
+
};
|
|
85
|
+
panel.bind('mouseover', hover);
|
|
86
|
+
//执行离开
|
|
87
|
+
const leave = options.leave || function() {
|
|
88
|
+
//应用图的普通样式
|
|
89
|
+
//Object.assign(series.style, series.style.normal);
|
|
90
|
+
|
|
91
|
+
//Object.assign(this.style, this.style.normal || {});
|
|
92
|
+
//jmUtils.apply(this.series.style.normal,this.series.style);
|
|
93
|
+
//series.graph.refresh();
|
|
94
|
+
};
|
|
95
|
+
panel.bind('mouseleave', leave);*/
|
|
96
|
+
|
|
97
|
+
const legendPosition = this.legendPosition || this.style.legendPosition || 'right';
|
|
98
|
+
if(legendPosition == 'top' || legendPosition == 'bottom') {
|
|
99
|
+
//顶部和底部图例横排,每次右移位一个单位图例
|
|
100
|
+
panel.position.x = this.width + 15 * this.graph.devicePixelRatio;
|
|
101
|
+
this.width = panel.position.x + panel.width; // 把容器宽指定为所有图例宽和
|
|
102
|
+
this.height = Math.max(panel.height, this.height);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
//右边和左边图例竖排
|
|
106
|
+
panel.position.y += this.height + 5 * this.graph.devicePixelRatio;
|
|
107
|
+
this.height = panel.position.y + panel.height;
|
|
108
|
+
this.width = Math.max(panel.width, this.width);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
this.needUpdate = true;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 初始化图例
|
|
116
|
+
*
|
|
117
|
+
* @method init
|
|
118
|
+
*/
|
|
119
|
+
jmLegend.prototype.init = function() {
|
|
120
|
+
this.position.x = 0;
|
|
121
|
+
this.position.y = 0;
|
|
122
|
+
this.width = 0;
|
|
123
|
+
this.height = 0;
|
|
124
|
+
this.style.lineWidth = 0;
|
|
125
|
+
this.children.clear();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* 重置图例属性,根据图例内容计算期大小并更新画图区域大小
|
|
130
|
+
*
|
|
131
|
+
* @method reset
|
|
132
|
+
*/
|
|
133
|
+
jmLegend.prototype.reset = function() {
|
|
134
|
+
|
|
135
|
+
if(this.visible !== false) {
|
|
136
|
+
this.position.x = this.graph.chartArea.position.x;
|
|
137
|
+
this.position.y = this.graph.chartArea.position.y;
|
|
138
|
+
var legendPosition = this.legendPosition || this.style.legendPosition;
|
|
139
|
+
switch(legendPosition) {
|
|
140
|
+
case 'left': {
|
|
141
|
+
this.graph.chartArea.width = this.graph.chartArea.width - this.width;
|
|
142
|
+
//画图区域向右偏移
|
|
143
|
+
this.graph.chartArea.position.x = this.position.x + this.width + this.style.margin.right * this.graph.devicePixelRatio;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
case 'top': {
|
|
147
|
+
this.graph.chartArea.height = this.graph.chartArea.height - this.height;
|
|
148
|
+
this.graph.chartArea.position.y = this.position.y + this.height + this.style.margin.bottom * this.graph.devicePixelRatio;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
case 'bottom': {
|
|
152
|
+
this.graph.chartArea.height = this.graph.chartArea.height - this.height;
|
|
153
|
+
this.position.y = this.graph.chartArea.position.y + this.graph.chartArea.height + this.style.margin.top * this.graph.devicePixelRatio;
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case 'right':
|
|
157
|
+
default: {
|
|
158
|
+
this.graph.chartArea.width = this.graph.chartArea.width - this.width;
|
|
159
|
+
this.position.x = this.graph.chartArea.position.x + this.graph.chartArea.width + this.style.margin.left * this.graph.devicePixelRatio;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
164
|
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
|
|
2
|
+
import jmMarkLine from './markLine';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 轴
|
|
6
|
+
*
|
|
7
|
+
* @class jmMarkLineManager
|
|
8
|
+
* @module jmChart
|
|
9
|
+
* @param {jmChart} chart 当前图表
|
|
10
|
+
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
11
|
+
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
12
|
+
* @param {object} [style] 样式
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export default class jmMarkLineManager {
|
|
16
|
+
constructor(chart) {
|
|
17
|
+
this.chart = chart;
|
|
18
|
+
this.init(chart);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// 初始化
|
|
22
|
+
init(chart) {
|
|
23
|
+
const graph = chart.touchGraph || chart;
|
|
24
|
+
|
|
25
|
+
graph.on('beginDraw', () => {
|
|
26
|
+
// 重置标线,会处理小圆圈问题
|
|
27
|
+
this.xMarkLine && this.xMarkLine.init();
|
|
28
|
+
this.yMarkLine && this.yMarkLine.init();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if(chart.style.markLine) {
|
|
32
|
+
// 生成标线,可以跟随鼠标或手指滑动
|
|
33
|
+
if(chart.style.markLine && chart.style.markLine.x) {
|
|
34
|
+
this.xMarkLine = graph.createShape(jmMarkLine, {
|
|
35
|
+
type: 'x',
|
|
36
|
+
style: chart.style.markLine
|
|
37
|
+
});
|
|
38
|
+
const area = graph.chartArea || graph;
|
|
39
|
+
area.children.add(this.xMarkLine);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if(chart.style.markLine && chart.style.markLine.y) {
|
|
43
|
+
this.yMarkLine = graph.createShape(jmMarkLine, {
|
|
44
|
+
type: 'y',
|
|
45
|
+
style: chart.style.markLine
|
|
46
|
+
});
|
|
47
|
+
const area = graph.chartArea || graph;
|
|
48
|
+
area.children.add(this.yMarkLine);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let longtap = 0;// 是否有长按, 0 未开始,1已按下,2识别为长按
|
|
52
|
+
let longtapHandler = 0;
|
|
53
|
+
let touchStartPos = {
|
|
54
|
+
x: 0,
|
|
55
|
+
y: 0
|
|
56
|
+
};
|
|
57
|
+
graph.on('mousedown touchstart', (args) => {
|
|
58
|
+
// 如果长按才启用
|
|
59
|
+
if(chart.style.markLine.longtap) {
|
|
60
|
+
longtap = 1;
|
|
61
|
+
longtapHandler && graph.utils.cancelAnimationFrame(longtapHandler);
|
|
62
|
+
let tapStartTime = Date.now();
|
|
63
|
+
const reqFun = ()=>{
|
|
64
|
+
const elapsed = Date.now() - tapStartTime;
|
|
65
|
+
if(longtap === 1 || longtap === 2) {
|
|
66
|
+
// 如果还未过一定时间,则继续等待
|
|
67
|
+
if(elapsed < 500) {
|
|
68
|
+
longtapHandler = graph.utils.requestAnimationFrame(reqFun);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
longtap = 2;
|
|
72
|
+
this.startMove(args);
|
|
73
|
+
chart.emit('marklinelongtapstart', args);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
// 如果一定时间后还没有取消,则表示长按了
|
|
77
|
+
longtapHandler = graph.utils.requestAnimationFrame(reqFun);
|
|
78
|
+
|
|
79
|
+
//args.event.stopPropagation();
|
|
80
|
+
args.event.preventDefault();// 阻止默认行为
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this.startMove(args);
|
|
84
|
+
}
|
|
85
|
+
args.longtap = longtap;
|
|
86
|
+
touchStartPos = args.position;
|
|
87
|
+
});
|
|
88
|
+
// 移动标线
|
|
89
|
+
graph.on('mousemove touchmove', (args) => {
|
|
90
|
+
const ox = args.position.x - touchStartPos.x;
|
|
91
|
+
const oy = args.position.y - touchStartPos.y;
|
|
92
|
+
const offpos = Math.sqrt(ox * ox + oy * oy);
|
|
93
|
+
if(longtap === 1 && offpos > 15) longtap = 0; // 如果移动了,则取消长按
|
|
94
|
+
|
|
95
|
+
args.longtap = longtap;
|
|
96
|
+
this.move(args);
|
|
97
|
+
});
|
|
98
|
+
// 取消移动
|
|
99
|
+
graph.on('mouseup touchend touchcancel touchleave', (args) => {
|
|
100
|
+
longtap = 0;
|
|
101
|
+
|
|
102
|
+
this.endMove(args);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 开始移动标线
|
|
108
|
+
startMove(args, markLineType = 'xy') {
|
|
109
|
+
if(this.xMarkLine && markLineType.includes('x')) {
|
|
110
|
+
this.xMarkLine.visible = true;
|
|
111
|
+
this.xMarkLine.move(args);
|
|
112
|
+
}
|
|
113
|
+
if(this.yMarkLine && markLineType.includes('y')) {
|
|
114
|
+
this.yMarkLine.visible = true;
|
|
115
|
+
this.yMarkLine.move(args);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if(!args.cancel) this.chart.emit('marklinestartmove', args);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// 移动标线
|
|
122
|
+
move(args) {
|
|
123
|
+
let moved = false;
|
|
124
|
+
if(this.xMarkLine && this.xMarkLine.visible) {
|
|
125
|
+
this.xMarkLine.move(args);
|
|
126
|
+
moved = true;
|
|
127
|
+
}
|
|
128
|
+
if(this.yMarkLine && this.yMarkLine.visible) {
|
|
129
|
+
this.yMarkLine.move(args);
|
|
130
|
+
moved = true;
|
|
131
|
+
}
|
|
132
|
+
if(moved) {
|
|
133
|
+
args.event.stopPropagation();
|
|
134
|
+
args.event.preventDefault();// 阻止默认行为
|
|
135
|
+
|
|
136
|
+
if(!args.cancel) this.chart.emit('marklinemove', args);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// 终止动移
|
|
140
|
+
endMove(args) {
|
|
141
|
+
if(this.xMarkLine && this.xMarkLine.visible) {
|
|
142
|
+
this.xMarkLine.cancel(args);
|
|
143
|
+
}
|
|
144
|
+
if(this.yMarkLine && this.yMarkLine.visible) {
|
|
145
|
+
this.yMarkLine.cancel(args);
|
|
146
|
+
}
|
|
147
|
+
if(!args.cancel) this.chart.emit('marklineendmove', args);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|