jmchart 1.1.93 → 1.1.94
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/dist/jmchart.amd.js +14 -4
- package/dist/jmchart.cjs.js +14 -4
- package/dist/jmchart.esm.js +14 -4
- package/dist/jmchart.iife.js +14 -4
- package/dist/jmchart.system.js +14 -4
- package/example/bar.html +20 -6
- package/package.json +1 -1
- package/src/core/markLine/manager.js +15 -4
package/dist/jmchart.amd.js
CHANGED
|
@@ -7976,10 +7976,20 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
7976
7976
|
}); // 移动标线
|
|
7977
7977
|
|
|
7978
7978
|
graph.on('mousemove touchmove', args => {
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7979
|
+
args.offsetInfo = {
|
|
7980
|
+
x: 0,
|
|
7981
|
+
y: 0,
|
|
7982
|
+
offset: 0
|
|
7983
|
+
};
|
|
7984
|
+
args.offsetInfo.x = args.position.x - touchStartPos.x;
|
|
7985
|
+
args.offsetInfo.y = args.position.y - touchStartPos.y;
|
|
7986
|
+
args.offsetInfo.offset = Math.sqrt(args.offsetInfo.x * args.offsetInfo.x + args.offsetInfo.y * args.offsetInfo.y); // 记录当次滑动的位置
|
|
7987
|
+
|
|
7988
|
+
touchStartPos = args.position; // 如果是长按启用,但手指又滑动了。则取消标线
|
|
7989
|
+
|
|
7990
|
+
if (longtap === 1) {
|
|
7991
|
+
if (args.offsetInfo.offset > 15) longtap = 0; // 如果移动了,则取消长按
|
|
7992
|
+
}
|
|
7983
7993
|
|
|
7984
7994
|
args.longtap = longtap;
|
|
7985
7995
|
this.move(args);
|
package/dist/jmchart.cjs.js
CHANGED
|
@@ -7978,10 +7978,20 @@ class jmMarkLineManager {
|
|
|
7978
7978
|
}); // 移动标线
|
|
7979
7979
|
|
|
7980
7980
|
graph.on('mousemove touchmove', args => {
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7981
|
+
args.offsetInfo = {
|
|
7982
|
+
x: 0,
|
|
7983
|
+
y: 0,
|
|
7984
|
+
offset: 0
|
|
7985
|
+
};
|
|
7986
|
+
args.offsetInfo.x = args.position.x - touchStartPos.x;
|
|
7987
|
+
args.offsetInfo.y = args.position.y - touchStartPos.y;
|
|
7988
|
+
args.offsetInfo.offset = Math.sqrt(args.offsetInfo.x * args.offsetInfo.x + args.offsetInfo.y * args.offsetInfo.y); // 记录当次滑动的位置
|
|
7989
|
+
|
|
7990
|
+
touchStartPos = args.position; // 如果是长按启用,但手指又滑动了。则取消标线
|
|
7991
|
+
|
|
7992
|
+
if (longtap === 1) {
|
|
7993
|
+
if (args.offsetInfo.offset > 15) longtap = 0; // 如果移动了,则取消长按
|
|
7994
|
+
}
|
|
7985
7995
|
|
|
7986
7996
|
args.longtap = longtap;
|
|
7987
7997
|
this.move(args);
|
package/dist/jmchart.esm.js
CHANGED
|
@@ -7974,10 +7974,20 @@ class jmMarkLineManager {
|
|
|
7974
7974
|
}); // 移动标线
|
|
7975
7975
|
|
|
7976
7976
|
graph.on('mousemove touchmove', args => {
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7977
|
+
args.offsetInfo = {
|
|
7978
|
+
x: 0,
|
|
7979
|
+
y: 0,
|
|
7980
|
+
offset: 0
|
|
7981
|
+
};
|
|
7982
|
+
args.offsetInfo.x = args.position.x - touchStartPos.x;
|
|
7983
|
+
args.offsetInfo.y = args.position.y - touchStartPos.y;
|
|
7984
|
+
args.offsetInfo.offset = Math.sqrt(args.offsetInfo.x * args.offsetInfo.x + args.offsetInfo.y * args.offsetInfo.y); // 记录当次滑动的位置
|
|
7985
|
+
|
|
7986
|
+
touchStartPos = args.position; // 如果是长按启用,但手指又滑动了。则取消标线
|
|
7987
|
+
|
|
7988
|
+
if (longtap === 1) {
|
|
7989
|
+
if (args.offsetInfo.offset > 15) longtap = 0; // 如果移动了,则取消长按
|
|
7990
|
+
}
|
|
7981
7991
|
|
|
7982
7992
|
args.longtap = longtap;
|
|
7983
7993
|
this.move(args);
|
package/dist/jmchart.iife.js
CHANGED
|
@@ -7977,10 +7977,20 @@
|
|
|
7977
7977
|
}); // 移动标线
|
|
7978
7978
|
|
|
7979
7979
|
graph.on('mousemove touchmove', args => {
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7980
|
+
args.offsetInfo = {
|
|
7981
|
+
x: 0,
|
|
7982
|
+
y: 0,
|
|
7983
|
+
offset: 0
|
|
7984
|
+
};
|
|
7985
|
+
args.offsetInfo.x = args.position.x - touchStartPos.x;
|
|
7986
|
+
args.offsetInfo.y = args.position.y - touchStartPos.y;
|
|
7987
|
+
args.offsetInfo.offset = Math.sqrt(args.offsetInfo.x * args.offsetInfo.x + args.offsetInfo.y * args.offsetInfo.y); // 记录当次滑动的位置
|
|
7988
|
+
|
|
7989
|
+
touchStartPos = args.position; // 如果是长按启用,但手指又滑动了。则取消标线
|
|
7990
|
+
|
|
7991
|
+
if (longtap === 1) {
|
|
7992
|
+
if (args.offsetInfo.offset > 15) longtap = 0; // 如果移动了,则取消长按
|
|
7993
|
+
}
|
|
7984
7994
|
|
|
7985
7995
|
args.longtap = longtap;
|
|
7986
7996
|
this.move(args);
|
package/dist/jmchart.system.js
CHANGED
|
@@ -7979,10 +7979,20 @@ System.register([], function (exports) {
|
|
|
7979
7979
|
}); // 移动标线
|
|
7980
7980
|
|
|
7981
7981
|
graph.on('mousemove touchmove', args => {
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7982
|
+
args.offsetInfo = {
|
|
7983
|
+
x: 0,
|
|
7984
|
+
y: 0,
|
|
7985
|
+
offset: 0
|
|
7986
|
+
};
|
|
7987
|
+
args.offsetInfo.x = args.position.x - touchStartPos.x;
|
|
7988
|
+
args.offsetInfo.y = args.position.y - touchStartPos.y;
|
|
7989
|
+
args.offsetInfo.offset = Math.sqrt(args.offsetInfo.x * args.offsetInfo.x + args.offsetInfo.y * args.offsetInfo.y); // 记录当次滑动的位置
|
|
7990
|
+
|
|
7991
|
+
touchStartPos = args.position; // 如果是长按启用,但手指又滑动了。则取消标线
|
|
7992
|
+
|
|
7993
|
+
if (longtap === 1) {
|
|
7994
|
+
if (args.offsetInfo.offset > 15) longtap = 0; // 如果移动了,则取消长按
|
|
7995
|
+
}
|
|
7986
7996
|
|
|
7987
7997
|
args.longtap = longtap;
|
|
7988
7998
|
this.move(args);
|
package/example/bar.html
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
y: true
|
|
54
54
|
},
|
|
55
55
|
markLine: {
|
|
56
|
-
longtap:
|
|
56
|
+
longtap: false // 长按才出现标线
|
|
57
57
|
},
|
|
58
58
|
margin: {
|
|
59
59
|
bottom: 2
|
|
@@ -66,14 +66,28 @@
|
|
|
66
66
|
|
|
67
67
|
// touch改变数据点事件
|
|
68
68
|
chart.on('touchPointChange', function(args) {
|
|
69
|
-
console.log(args);
|
|
69
|
+
//console.log(args);
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
+
var lineTouchIng = 0;// 1=启用标线状态,2=非标线,则可以触发系统行为
|
|
72
73
|
chart.on('marklinestartmove', (args)=>{
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
lineTouchIng = 0;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
chart.on('marklinemove', (args)=>{
|
|
79
|
+
if(args.event && args.offsetInfo) {
|
|
75
80
|
args.event.stopPropagation();
|
|
76
|
-
|
|
81
|
+
// 标线状态一直禁用系统能力
|
|
82
|
+
if((lineTouchIng === 0 && Math.abs(args.offsetInfo.y) <= 10) || lineTouchIng === 1) {
|
|
83
|
+
lineTouchIng = 1;
|
|
84
|
+
args.event.preventDefault(); // 阻止默认行为
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
if(lineTouchIng === 0) lineTouchIng = 2;
|
|
88
|
+
console.log('marklinemove', args);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
77
91
|
});
|
|
78
92
|
|
|
79
93
|
|
|
@@ -94,7 +108,7 @@
|
|
|
94
108
|
color: 'transparent'
|
|
95
109
|
},
|
|
96
110
|
fill: function(point) {
|
|
97
|
-
console.log(point);
|
|
111
|
+
//console.log(point);
|
|
98
112
|
if(point.yValue < 0) return 'green';
|
|
99
113
|
else return 'red';
|
|
100
114
|
}
|
package/package.json
CHANGED
|
@@ -87,11 +87,22 @@ export default class jmMarkLineManager {
|
|
|
87
87
|
});
|
|
88
88
|
// 移动标线
|
|
89
89
|
graph.on('mousemove touchmove', (args) => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
args.offsetInfo = {
|
|
91
|
+
x: 0,
|
|
92
|
+
y: 0,
|
|
93
|
+
offset: 0
|
|
94
|
+
};
|
|
95
|
+
args.offsetInfo.x = args.position.x - touchStartPos.x;
|
|
96
|
+
args.offsetInfo.y = args.position.y - touchStartPos.y;
|
|
97
|
+
args.offsetInfo.offset = Math.sqrt(args.offsetInfo.x * args.offsetInfo.x + args.offsetInfo.y * args.offsetInfo.y);
|
|
98
|
+
|
|
99
|
+
// 记录当次滑动的位置
|
|
100
|
+
touchStartPos = args.position;
|
|
94
101
|
|
|
102
|
+
// 如果是长按启用,但手指又滑动了。则取消标线
|
|
103
|
+
if(longtap === 1) {
|
|
104
|
+
if(args.offsetInfo.offset > 15) longtap = 0; // 如果移动了,则取消长按
|
|
105
|
+
}
|
|
95
106
|
args.longtap = longtap;
|
|
96
107
|
this.move(args);
|
|
97
108
|
});
|