jmchart 1.1.78 → 1.1.79
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 +360 -357
- package/dist/jmchart.cjs.js +359 -356
- package/dist/jmchart.esm.js +360 -356
- package/dist/jmchart.iife.js +359 -358
- package/dist/jmchart.system.js +359 -356
- package/example/bar.html +2 -1
- package/package.json +1 -1
- package/src/series/barSeries.js +9 -2
package/dist/jmchart.esm.js
CHANGED
|
@@ -3963,7 +3963,7 @@ class jmLabel extends jmControl {
|
|
|
3963
3963
|
|
|
3964
3964
|
//获取当前控件的绝对位置
|
|
3965
3965
|
let bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
|
|
3966
|
-
this.testSize();
|
|
3966
|
+
let size = this.testSize();
|
|
3967
3967
|
let location = this.location;
|
|
3968
3968
|
let x = location.left + bounds.left;
|
|
3969
3969
|
let y = location.top + bounds.top;
|
|
@@ -4407,7 +4407,7 @@ class jmMouseEvent {
|
|
|
4407
4407
|
|
|
4408
4408
|
this.eventEvents['mousedown'] = jmUtils.bindEvent(this.target,'mousedown',function(evt) {
|
|
4409
4409
|
evt = evt || window.event;
|
|
4410
|
-
container.raiseEvent('mousedown',evt);
|
|
4410
|
+
let r = container.raiseEvent('mousedown',evt);
|
|
4411
4411
|
//if(r === false) {
|
|
4412
4412
|
//if(evt.preventDefault) evt.preventDefault();
|
|
4413
4413
|
//return false;
|
|
@@ -4418,7 +4418,7 @@ class jmMouseEvent {
|
|
|
4418
4418
|
evt = evt || window.event;
|
|
4419
4419
|
let target = evt.target || evt.srcElement;
|
|
4420
4420
|
if(target == canvas) {
|
|
4421
|
-
container.raiseEvent('mousemove',evt);
|
|
4421
|
+
let r = container.raiseEvent('mousemove',evt);
|
|
4422
4422
|
//if(r === false) {
|
|
4423
4423
|
if(evt.preventDefault) evt.preventDefault();
|
|
4424
4424
|
return false;
|
|
@@ -4580,7 +4580,7 @@ class jmKeyEvent {
|
|
|
4580
4580
|
* @param {object} option 参数:{width:宽,height:高}
|
|
4581
4581
|
* @param {function} callback 初始化后的回调
|
|
4582
4582
|
*/
|
|
4583
|
-
class jmGraph
|
|
4583
|
+
class jmGraph extends jmControl {
|
|
4584
4584
|
|
|
4585
4585
|
constructor(canvas, option, callback) {
|
|
4586
4586
|
if(typeof option == 'function') {
|
|
@@ -4758,7 +4758,7 @@ class jmGraph$1 extends jmControl {
|
|
|
4758
4758
|
* @return {jmGraph} jmGraph实例对象
|
|
4759
4759
|
*/
|
|
4760
4760
|
static create(...args) {
|
|
4761
|
-
return new jmGraph
|
|
4761
|
+
return new jmGraph(...args);
|
|
4762
4762
|
}
|
|
4763
4763
|
|
|
4764
4764
|
/**
|
|
@@ -5104,7 +5104,7 @@ const shapes = {
|
|
|
5104
5104
|
"resize": jmResize
|
|
5105
5105
|
};
|
|
5106
5106
|
|
|
5107
|
-
class jmGraph extends jmGraph
|
|
5107
|
+
class jmGraph$1 extends jmGraph {
|
|
5108
5108
|
constructor(canvas, option, callback) {
|
|
5109
5109
|
|
|
5110
5110
|
const targetType = new.target;
|
|
@@ -5114,9 +5114,9 @@ class jmGraph extends jmGraph$1 {
|
|
|
5114
5114
|
option.shapes = Object.assign(shapes, option.shapes||{});
|
|
5115
5115
|
|
|
5116
5116
|
//不是用new实例化的话,返回一个promise
|
|
5117
|
-
if(!targetType || !(targetType.prototype instanceof jmGraph
|
|
5117
|
+
if(!targetType || !(targetType.prototype instanceof jmGraph)) {
|
|
5118
5118
|
return new Promise(function(resolve, reject){
|
|
5119
|
-
var g = new jmGraph(canvas, option, callback);
|
|
5119
|
+
var g = new jmGraph$1(canvas, option, callback);
|
|
5120
5120
|
if(resolve) resolve(g);
|
|
5121
5121
|
});
|
|
5122
5122
|
}
|
|
@@ -5130,12 +5130,12 @@ class jmGraph extends jmGraph$1 {
|
|
|
5130
5130
|
}
|
|
5131
5131
|
}
|
|
5132
5132
|
|
|
5133
|
-
/**
|
|
5134
|
-
* 基础样式
|
|
5135
|
-
*
|
|
5136
|
-
* @class jmChartStyle
|
|
5137
|
-
* @module jmChart
|
|
5138
|
-
* @static
|
|
5133
|
+
/**
|
|
5134
|
+
* 基础样式
|
|
5135
|
+
*
|
|
5136
|
+
* @class jmChartStyle
|
|
5137
|
+
* @module jmChart
|
|
5138
|
+
* @static
|
|
5139
5139
|
*/
|
|
5140
5140
|
var defaultStyle = {
|
|
5141
5141
|
layout: 'normal',
|
|
@@ -5271,13 +5271,13 @@ var defaultStyle = {
|
|
|
5271
5271
|
// 图形样式集
|
|
5272
5272
|
chartColors: ['#249FDA', '#EA3B7C', '#8EBC00', '#309B46', '#4B507E', '#D8E404', '#EB792A', '#A00DA0'],
|
|
5273
5273
|
|
|
5274
|
-
/*tooltip: {
|
|
5275
|
-
'background-color': 'rgb(255,255,255)',
|
|
5276
|
-
'padding':'4px',
|
|
5277
|
-
'opacity':'0.8',
|
|
5278
|
-
'border':'1px solid #000',
|
|
5279
|
-
'box-shadow': '0 0 3px #000',
|
|
5280
|
-
'border-radius': '6px'
|
|
5274
|
+
/*tooltip: {
|
|
5275
|
+
'background-color': 'rgb(255,255,255)',
|
|
5276
|
+
'padding':'4px',
|
|
5277
|
+
'opacity':'0.8',
|
|
5278
|
+
'border':'1px solid #000',
|
|
5279
|
+
'box-shadow': '0 0 3px #000',
|
|
5280
|
+
'border-radius': '6px'
|
|
5281
5281
|
},*/
|
|
5282
5282
|
line: {
|
|
5283
5283
|
normal: {
|
|
@@ -5387,15 +5387,15 @@ var defaultStyle = {
|
|
|
5387
5387
|
}
|
|
5388
5388
|
};
|
|
5389
5389
|
|
|
5390
|
-
/**
|
|
5391
|
-
* 轴
|
|
5392
|
-
*
|
|
5393
|
-
* @class jmAxis
|
|
5394
|
-
* @module jmChart
|
|
5395
|
-
* @param {jmChart} chart 当前图表
|
|
5396
|
-
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
5397
|
-
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
5398
|
-
* @param {object} [style] 样式
|
|
5390
|
+
/**
|
|
5391
|
+
* 轴
|
|
5392
|
+
*
|
|
5393
|
+
* @class jmAxis
|
|
5394
|
+
* @module jmChart
|
|
5395
|
+
* @param {jmChart} chart 当前图表
|
|
5396
|
+
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
5397
|
+
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
5398
|
+
* @param {object} [style] 样式
|
|
5399
5399
|
*/
|
|
5400
5400
|
|
|
5401
5401
|
class jmAxis extends jmArrowLine {
|
|
@@ -5447,16 +5447,16 @@ class jmAxis extends jmArrowLine {
|
|
|
5447
5447
|
if (typeof options.minYValue !== 'undefined') this.minValue = options.minYValue; // 最小值,如果指定了,则轴的最小值为它或更小的值
|
|
5448
5448
|
}
|
|
5449
5449
|
}
|
|
5450
|
-
/**
|
|
5451
|
-
* 轴类型(x/y/radar),默认为x
|
|
5452
|
-
*
|
|
5453
|
-
* @property type
|
|
5454
|
-
* @type string
|
|
5450
|
+
/**
|
|
5451
|
+
* 轴类型(x/y/radar),默认为x
|
|
5452
|
+
*
|
|
5453
|
+
* @property type
|
|
5454
|
+
* @type string
|
|
5455
5455
|
*/
|
|
5456
5456
|
|
|
5457
5457
|
|
|
5458
|
-
/**
|
|
5459
|
-
* 关联访问的是chart的数据源
|
|
5458
|
+
/**
|
|
5459
|
+
* 关联访问的是chart的数据源
|
|
5460
5460
|
*/
|
|
5461
5461
|
get data() {
|
|
5462
5462
|
return this.graph.data;
|
|
@@ -5465,10 +5465,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5465
5465
|
set data(d) {
|
|
5466
5466
|
this.graph.data = d;
|
|
5467
5467
|
}
|
|
5468
|
-
/**
|
|
5469
|
-
* 计算当前轴的位置
|
|
5470
|
-
*
|
|
5471
|
-
* @method reset
|
|
5468
|
+
/**
|
|
5469
|
+
* 计算当前轴的位置
|
|
5470
|
+
*
|
|
5471
|
+
* @method reset
|
|
5472
5472
|
*/
|
|
5473
5473
|
|
|
5474
5474
|
|
|
@@ -5526,10 +5526,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5526
5526
|
|
|
5527
5527
|
super.draw();
|
|
5528
5528
|
}
|
|
5529
|
-
/**
|
|
5530
|
-
* 生成轴标签
|
|
5531
|
-
*
|
|
5532
|
-
* @method createLabel
|
|
5529
|
+
/**
|
|
5530
|
+
* 生成轴标签
|
|
5531
|
+
*
|
|
5532
|
+
* @method createLabel
|
|
5533
5533
|
*/
|
|
5534
5534
|
|
|
5535
5535
|
|
|
@@ -5546,11 +5546,11 @@ class jmAxis extends jmArrowLine {
|
|
|
5546
5546
|
this.createYLabel();
|
|
5547
5547
|
}
|
|
5548
5548
|
}
|
|
5549
|
-
/**
|
|
5550
|
-
* 生成X轴标签
|
|
5551
|
-
*
|
|
5552
|
-
* @method createXLabel
|
|
5553
|
-
* @private
|
|
5549
|
+
/**
|
|
5550
|
+
* 生成X轴标签
|
|
5551
|
+
*
|
|
5552
|
+
* @method createXLabel
|
|
5553
|
+
* @private
|
|
5554
5554
|
*/
|
|
5555
5555
|
|
|
5556
5556
|
|
|
@@ -5641,11 +5641,11 @@ class jmAxis extends jmArrowLine {
|
|
|
5641
5641
|
}
|
|
5642
5642
|
}
|
|
5643
5643
|
}
|
|
5644
|
-
/**
|
|
5645
|
-
* 生成Y轴标签
|
|
5646
|
-
*
|
|
5647
|
-
* @method createYLabel
|
|
5648
|
-
* @private
|
|
5644
|
+
/**
|
|
5645
|
+
* 生成Y轴标签
|
|
5646
|
+
*
|
|
5647
|
+
* @method createYLabel
|
|
5648
|
+
* @private
|
|
5649
5649
|
*/
|
|
5650
5650
|
|
|
5651
5651
|
|
|
@@ -5658,8 +5658,8 @@ class jmAxis extends jmArrowLine {
|
|
|
5658
5658
|
|
|
5659
5659
|
let count = this.labelCount;
|
|
5660
5660
|
const mm = max - min;
|
|
5661
|
-
/*if(mm <= 10) {
|
|
5662
|
-
count = mm;
|
|
5661
|
+
/*if(mm <= 10) {
|
|
5662
|
+
count = mm;
|
|
5663
5663
|
}*/
|
|
5664
5664
|
// mm 放大10000倍,这里结果也需要除于10000
|
|
5665
5665
|
|
|
@@ -5771,10 +5771,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5771
5771
|
}
|
|
5772
5772
|
}
|
|
5773
5773
|
}
|
|
5774
|
-
/**
|
|
5775
|
-
* 获取当前轴所占宽
|
|
5776
|
-
*
|
|
5777
|
-
* @method width
|
|
5774
|
+
/**
|
|
5775
|
+
* 获取当前轴所占宽
|
|
5776
|
+
*
|
|
5777
|
+
* @method width
|
|
5778
5778
|
*/
|
|
5779
5779
|
|
|
5780
5780
|
|
|
@@ -5789,10 +5789,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5789
5789
|
set width(w) {
|
|
5790
5790
|
this._width = w;
|
|
5791
5791
|
}
|
|
5792
|
-
/**
|
|
5793
|
-
* 获取当前轴所占高
|
|
5794
|
-
*
|
|
5795
|
-
* @method height
|
|
5792
|
+
/**
|
|
5793
|
+
* 获取当前轴所占高
|
|
5794
|
+
*
|
|
5795
|
+
* @method height
|
|
5796
5796
|
*/
|
|
5797
5797
|
|
|
5798
5798
|
|
|
@@ -5802,12 +5802,12 @@ class jmAxis extends jmArrowLine {
|
|
|
5802
5802
|
|
|
5803
5803
|
|
|
5804
5804
|
set height(h) {}
|
|
5805
|
-
/**
|
|
5806
|
-
* 获取或设置当前轴最大值
|
|
5807
|
-
*
|
|
5808
|
-
* @method max
|
|
5809
|
-
* @param {number/date/string} 当前轴的最大值
|
|
5810
|
-
* @return 当前轴的最大值
|
|
5805
|
+
/**
|
|
5806
|
+
* 获取或设置当前轴最大值
|
|
5807
|
+
*
|
|
5808
|
+
* @method max
|
|
5809
|
+
* @param {number/date/string} 当前轴的最大值
|
|
5810
|
+
* @return 当前轴的最大值
|
|
5811
5811
|
*/
|
|
5812
5812
|
|
|
5813
5813
|
|
|
@@ -5856,12 +5856,12 @@ class jmAxis extends jmArrowLine {
|
|
|
5856
5856
|
|
|
5857
5857
|
return this._max;
|
|
5858
5858
|
}
|
|
5859
|
-
/**
|
|
5860
|
-
* 获取或设置当前轴最小值
|
|
5861
|
-
*
|
|
5862
|
-
* @method max
|
|
5863
|
-
* @param {number/date/string} 当前轴的最小值
|
|
5864
|
-
* @return 当前轴的最小值
|
|
5859
|
+
/**
|
|
5860
|
+
* 获取或设置当前轴最小值
|
|
5861
|
+
*
|
|
5862
|
+
* @method max
|
|
5863
|
+
* @param {number/date/string} 当前轴的最小值
|
|
5864
|
+
* @return 当前轴的最小值
|
|
5865
5865
|
*/
|
|
5866
5866
|
|
|
5867
5867
|
|
|
@@ -5908,10 +5908,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5908
5908
|
|
|
5909
5909
|
return this.dataType == 'string' ? 0 : this._min;
|
|
5910
5910
|
}
|
|
5911
|
-
/**
|
|
5912
|
-
* 清除一些属性
|
|
5913
|
-
*
|
|
5914
|
-
* @method clear
|
|
5911
|
+
/**
|
|
5912
|
+
* 清除一些属性
|
|
5913
|
+
*
|
|
5914
|
+
* @method clear
|
|
5915
5915
|
*/
|
|
5916
5916
|
|
|
5917
5917
|
|
|
@@ -5919,11 +5919,11 @@ class jmAxis extends jmArrowLine {
|
|
|
5919
5919
|
this._min = null;
|
|
5920
5920
|
this._max = null;
|
|
5921
5921
|
}
|
|
5922
|
-
/**
|
|
5923
|
-
* 计算当前轴的单位偏移量
|
|
5924
|
-
*
|
|
5925
|
-
* @method step
|
|
5926
|
-
* @return {number} 单位偏移量
|
|
5922
|
+
/**
|
|
5923
|
+
* 计算当前轴的单位偏移量
|
|
5924
|
+
*
|
|
5925
|
+
* @method step
|
|
5926
|
+
* @return {number} 单位偏移量
|
|
5927
5927
|
*/
|
|
5928
5928
|
|
|
5929
5929
|
|
|
@@ -5972,12 +5972,12 @@ class jmAxis extends jmArrowLine {
|
|
|
5972
5972
|
|
|
5973
5973
|
}
|
|
5974
5974
|
|
|
5975
|
-
/**
|
|
5976
|
-
* 图例的容器
|
|
5977
|
-
*
|
|
5978
|
-
* @class jmLegend
|
|
5979
|
-
* @module jmChart
|
|
5980
|
-
* @param {jmChart} chart 当前图表
|
|
5975
|
+
/**
|
|
5976
|
+
* 图例的容器
|
|
5977
|
+
*
|
|
5978
|
+
* @class jmLegend
|
|
5979
|
+
* @module jmChart
|
|
5980
|
+
* @param {jmChart} chart 当前图表
|
|
5981
5981
|
*/
|
|
5982
5982
|
|
|
5983
5983
|
class jmLegend extends jmRect {
|
|
@@ -5991,18 +5991,18 @@ class jmLegend extends jmRect {
|
|
|
5991
5991
|
|
|
5992
5992
|
_defineProperty(this, "legendPosition", 'right');
|
|
5993
5993
|
}
|
|
5994
|
-
/**
|
|
5995
|
-
* 图例放置位置
|
|
5994
|
+
/**
|
|
5995
|
+
* 图例放置位置
|
|
5996
5996
|
*/
|
|
5997
5997
|
|
|
5998
5998
|
|
|
5999
5999
|
}
|
|
6000
|
-
/**
|
|
6001
|
-
* 添加图例
|
|
6002
|
-
*
|
|
6003
|
-
* @method append
|
|
6004
|
-
* @param {jmSeries} series 当前图序列
|
|
6005
|
-
* @param {jmControl} shape 当前图例的图形对象
|
|
6000
|
+
/**
|
|
6001
|
+
* 添加图例
|
|
6002
|
+
*
|
|
6003
|
+
* @method append
|
|
6004
|
+
* @param {jmSeries} series 当前图序列
|
|
6005
|
+
* @param {jmControl} shape 当前图例的图形对象
|
|
6006
6006
|
*/
|
|
6007
6007
|
|
|
6008
6008
|
jmLegend.prototype.append = function (series, shape, options = {}) {
|
|
@@ -6042,24 +6042,21 @@ jmLegend.prototype.append = function (series, shape, options = {}) {
|
|
|
6042
6042
|
panel.height = shape.height; //执行进入事件
|
|
6043
6043
|
//触动图例后加粗显示图
|
|
6044
6044
|
|
|
6045
|
-
/*const hover = options.hover || function() {
|
|
6046
|
-
//应用图的动态样式
|
|
6047
|
-
//Object.assign(series.style, series.style.hover);
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
//
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
//jmUtils.apply(this.series.style.normal,this.series.style);
|
|
6061
|
-
//series.graph.refresh();
|
|
6062
|
-
};
|
|
6045
|
+
/*const hover = options.hover || function() {
|
|
6046
|
+
//应用图的动态样式
|
|
6047
|
+
//Object.assign(series.style, series.style.hover);
|
|
6048
|
+
//Object.assign(this.style, this.style.hover || {});
|
|
6049
|
+
//series.graph.refresh();
|
|
6050
|
+
};
|
|
6051
|
+
panel.bind('mouseover', hover);
|
|
6052
|
+
//执行离开
|
|
6053
|
+
const leave = options.leave || function() {
|
|
6054
|
+
//应用图的普通样式
|
|
6055
|
+
//Object.assign(series.style, series.style.normal);
|
|
6056
|
+
//Object.assign(this.style, this.style.normal || {});
|
|
6057
|
+
//jmUtils.apply(this.series.style.normal,this.series.style);
|
|
6058
|
+
//series.graph.refresh();
|
|
6059
|
+
};
|
|
6063
6060
|
panel.bind('mouseleave', leave);*/
|
|
6064
6061
|
|
|
6065
6062
|
const legendPosition = this.legendPosition || this.style.legendPosition;
|
|
@@ -6079,10 +6076,10 @@ jmLegend.prototype.append = function (series, shape, options = {}) {
|
|
|
6079
6076
|
|
|
6080
6077
|
this.needUpdate = true;
|
|
6081
6078
|
};
|
|
6082
|
-
/**
|
|
6083
|
-
* 初始化图例
|
|
6084
|
-
*
|
|
6085
|
-
* @method init
|
|
6079
|
+
/**
|
|
6080
|
+
* 初始化图例
|
|
6081
|
+
*
|
|
6082
|
+
* @method init
|
|
6086
6083
|
*/
|
|
6087
6084
|
|
|
6088
6085
|
|
|
@@ -6094,10 +6091,10 @@ jmLegend.prototype.init = function () {
|
|
|
6094
6091
|
this.style.lineWidth = 0;
|
|
6095
6092
|
this.children.clear();
|
|
6096
6093
|
};
|
|
6097
|
-
/**
|
|
6098
|
-
* 重置图例属性,根据图例内容计算期大小并更新画图区域大小
|
|
6099
|
-
*
|
|
6100
|
-
* @method reset
|
|
6094
|
+
/**
|
|
6095
|
+
* 重置图例属性,根据图例内容计算期大小并更新画图区域大小
|
|
6096
|
+
*
|
|
6097
|
+
* @method reset
|
|
6101
6098
|
*/
|
|
6102
6099
|
|
|
6103
6100
|
|
|
@@ -6142,11 +6139,11 @@ jmLegend.prototype.reset = function () {
|
|
|
6142
6139
|
};
|
|
6143
6140
|
|
|
6144
6141
|
var utils = {
|
|
6145
|
-
/**
|
|
6146
|
-
* 对比二个数组数据是否改变
|
|
6147
|
-
* @param {Array} source 被对比的数、组
|
|
6148
|
-
* @param {Array} target 对比数组
|
|
6149
|
-
* @param {Function} compare 比较函数
|
|
6142
|
+
/**
|
|
6143
|
+
* 对比二个数组数据是否改变
|
|
6144
|
+
* @param {Array} source 被对比的数、组
|
|
6145
|
+
* @param {Array} target 对比数组
|
|
6146
|
+
* @param {Function} compare 比较函数
|
|
6150
6147
|
*/
|
|
6151
6148
|
arrayIsChange(source, target, compare) {
|
|
6152
6149
|
if (!source || !target) return true;
|
|
@@ -6163,14 +6160,14 @@ var utils = {
|
|
|
6163
6160
|
|
|
6164
6161
|
};
|
|
6165
6162
|
|
|
6166
|
-
/**
|
|
6167
|
-
* 图形基类
|
|
6168
|
-
*
|
|
6169
|
-
* @class jmSeries
|
|
6170
|
-
* @module jmChart
|
|
6171
|
-
* @param {jmChart} chart 当前图表
|
|
6172
|
-
* @param {array} mappings 图形字段映射
|
|
6173
|
-
* @param {style} style 样式
|
|
6163
|
+
/**
|
|
6164
|
+
* 图形基类
|
|
6165
|
+
*
|
|
6166
|
+
* @class jmSeries
|
|
6167
|
+
* @module jmChart
|
|
6168
|
+
* @param {jmChart} chart 当前图表
|
|
6169
|
+
* @param {array} mappings 图形字段映射
|
|
6170
|
+
* @param {style} style 样式
|
|
6174
6171
|
*/
|
|
6175
6172
|
//构造线图
|
|
6176
6173
|
|
|
@@ -6214,8 +6211,8 @@ class jmSeries extends jmPath {
|
|
|
6214
6211
|
maxYValue: options.maxYValue
|
|
6215
6212
|
});
|
|
6216
6213
|
}
|
|
6217
|
-
/**
|
|
6218
|
-
* 关联访问的是chart的数据源
|
|
6214
|
+
/**
|
|
6215
|
+
* 关联访问的是chart的数据源
|
|
6219
6216
|
*/
|
|
6220
6217
|
|
|
6221
6218
|
|
|
@@ -6237,11 +6234,11 @@ class jmSeries extends jmPath {
|
|
|
6237
6234
|
set enableAnimate(v) {
|
|
6238
6235
|
this.option.enableAnimate = v;
|
|
6239
6236
|
}
|
|
6240
|
-
/**
|
|
6241
|
-
* 图例名称
|
|
6242
|
-
*
|
|
6243
|
-
* @property legendLabel
|
|
6244
|
-
* @type string
|
|
6237
|
+
/**
|
|
6238
|
+
* 图例名称
|
|
6239
|
+
*
|
|
6240
|
+
* @property legendLabel
|
|
6241
|
+
* @type string
|
|
6245
6242
|
*/
|
|
6246
6243
|
|
|
6247
6244
|
|
|
@@ -6271,10 +6268,10 @@ class jmSeries extends jmPath {
|
|
|
6271
6268
|
points: this.dataPoints
|
|
6272
6269
|
};
|
|
6273
6270
|
}
|
|
6274
|
-
/**
|
|
6275
|
-
* 根据X轴坐标,获取它最近的数据描点
|
|
6276
|
-
* 离点最近的一个描点
|
|
6277
|
-
* @param {number} x X轴坐标
|
|
6271
|
+
/**
|
|
6272
|
+
* 根据X轴坐标,获取它最近的数据描点
|
|
6273
|
+
* 离点最近的一个描点
|
|
6274
|
+
* @param {number} x X轴坐标
|
|
6278
6275
|
*/
|
|
6279
6276
|
|
|
6280
6277
|
|
|
@@ -6294,7 +6291,7 @@ class jmSeries extends jmPath {
|
|
|
6294
6291
|
} // 下一个点
|
|
6295
6292
|
|
|
6296
6293
|
|
|
6297
|
-
if (p.x > x) {
|
|
6294
|
+
if ( p.x > x) {
|
|
6298
6295
|
// 没有上一个,只能返回这个了
|
|
6299
6296
|
if (prePoint && x - prePoint.x < p.x - x) return prePoint;else return p;
|
|
6300
6297
|
}
|
|
@@ -6302,9 +6299,9 @@ class jmSeries extends jmPath {
|
|
|
6302
6299
|
|
|
6303
6300
|
return null;
|
|
6304
6301
|
}
|
|
6305
|
-
/**
|
|
6306
|
-
* 根据X轴值获取数据点
|
|
6307
|
-
* @param {number} xValue X轴值
|
|
6302
|
+
/**
|
|
6303
|
+
* 根据X轴值获取数据点
|
|
6304
|
+
* @param {number} xValue X轴值
|
|
6308
6305
|
*/
|
|
6309
6306
|
|
|
6310
6307
|
|
|
@@ -6318,11 +6315,11 @@ class jmSeries extends jmPath {
|
|
|
6318
6315
|
|
|
6319
6316
|
return null;
|
|
6320
6317
|
}
|
|
6321
|
-
/**
|
|
6322
|
-
* 重置属性
|
|
6323
|
-
* 根据数据源计算轴的属性
|
|
6324
|
-
*
|
|
6325
|
-
* @method reset
|
|
6318
|
+
/**
|
|
6319
|
+
* 重置属性
|
|
6320
|
+
* 根据数据源计算轴的属性
|
|
6321
|
+
*
|
|
6322
|
+
* @method reset
|
|
6326
6323
|
*/
|
|
6327
6324
|
|
|
6328
6325
|
|
|
@@ -6366,10 +6363,10 @@ class jmSeries extends jmPath {
|
|
|
6366
6363
|
this.xAxis.min(xv);
|
|
6367
6364
|
}
|
|
6368
6365
|
}
|
|
6369
|
-
/**
|
|
6370
|
-
* 生成序列图描点
|
|
6371
|
-
*
|
|
6372
|
-
* @method createPoints
|
|
6366
|
+
/**
|
|
6367
|
+
* 生成序列图描点
|
|
6368
|
+
*
|
|
6369
|
+
* @method createPoints
|
|
6373
6370
|
*/
|
|
6374
6371
|
|
|
6375
6372
|
|
|
@@ -6446,10 +6443,10 @@ class jmSeries extends jmPath {
|
|
|
6446
6443
|
return this.style.color;
|
|
6447
6444
|
}
|
|
6448
6445
|
}
|
|
6449
|
-
/**
|
|
6450
|
-
* 生成图例
|
|
6451
|
-
*
|
|
6452
|
-
* @method createLegend
|
|
6446
|
+
/**
|
|
6447
|
+
* 生成图例
|
|
6448
|
+
*
|
|
6449
|
+
* @method createLegend
|
|
6453
6450
|
*/
|
|
6454
6451
|
|
|
6455
6452
|
|
|
@@ -6501,9 +6498,9 @@ class jmSeries extends jmPath {
|
|
|
6501
6498
|
});
|
|
6502
6499
|
this.addShape(label);
|
|
6503
6500
|
}
|
|
6504
|
-
/**
|
|
6505
|
-
* 在图上加下定制图形
|
|
6506
|
-
* @param {jmShape} shape 图形
|
|
6501
|
+
/**
|
|
6502
|
+
* 在图上加下定制图形
|
|
6503
|
+
* @param {jmShape} shape 图形
|
|
6507
6504
|
*/
|
|
6508
6505
|
|
|
6509
6506
|
|
|
@@ -6512,13 +6509,13 @@ class jmSeries extends jmPath {
|
|
|
6512
6509
|
this.shapes.add(shape);
|
|
6513
6510
|
return shape;
|
|
6514
6511
|
}
|
|
6515
|
-
/**
|
|
6516
|
-
* 获取指定事件的集合
|
|
6517
|
-
* 比如mousedown,mouseup等
|
|
6518
|
-
*
|
|
6519
|
-
* @method getEvent
|
|
6520
|
-
* @param {string} name 事件名称
|
|
6521
|
-
* @return {list} 事件委托的集合
|
|
6512
|
+
/**
|
|
6513
|
+
* 获取指定事件的集合
|
|
6514
|
+
* 比如mousedown,mouseup等
|
|
6515
|
+
*
|
|
6516
|
+
* @method getEvent
|
|
6517
|
+
* @param {string} name 事件名称
|
|
6518
|
+
* @return {list} 事件委托的集合
|
|
6522
6519
|
*/
|
|
6523
6520
|
|
|
6524
6521
|
|
|
@@ -6542,14 +6539,14 @@ class jmSeries extends jmPath {
|
|
|
6542
6539
|
|
|
6543
6540
|
}
|
|
6544
6541
|
|
|
6545
|
-
/**
|
|
6546
|
-
* 柱图
|
|
6547
|
-
*
|
|
6548
|
-
* @class jmBarSeries
|
|
6549
|
-
* @module jmChart
|
|
6550
|
-
* @param {jmChart} chart 当前图表
|
|
6551
|
-
* @param {array} mappings 图形字段映射
|
|
6552
|
-
* @param {style} style 样式
|
|
6542
|
+
/**
|
|
6543
|
+
* 柱图
|
|
6544
|
+
*
|
|
6545
|
+
* @class jmBarSeries
|
|
6546
|
+
* @module jmChart
|
|
6547
|
+
* @param {jmChart} chart 当前图表
|
|
6548
|
+
* @param {array} mappings 图形字段映射
|
|
6549
|
+
* @param {style} style 样式
|
|
6553
6550
|
*/
|
|
6554
6551
|
//构造函数
|
|
6555
6552
|
|
|
@@ -6557,11 +6554,11 @@ class jmBarSeries extends jmSeries {
|
|
|
6557
6554
|
constructor(options) {
|
|
6558
6555
|
super(options);
|
|
6559
6556
|
}
|
|
6560
|
-
/**
|
|
6561
|
-
* 绘制当前图形
|
|
6562
|
-
*
|
|
6563
|
-
* @method beginDraw
|
|
6564
|
-
* @for jmBarSeries
|
|
6557
|
+
/**
|
|
6558
|
+
* 绘制当前图形
|
|
6559
|
+
*
|
|
6560
|
+
* @method beginDraw
|
|
6561
|
+
* @for jmBarSeries
|
|
6565
6562
|
*/
|
|
6566
6563
|
|
|
6567
6564
|
|
|
@@ -6654,17 +6651,23 @@ class jmBarSeries extends jmSeries {
|
|
|
6654
6651
|
//计算每个柱子占宽
|
|
6655
6652
|
//每项柱子占宽除以柱子个数,默认最大宽度为30
|
|
6656
6653
|
const maxWidth = this.xAxis.width / count / this.graph.barSeriesCount;
|
|
6657
|
-
|
|
6658
|
-
this.barWidth
|
|
6654
|
+
|
|
6655
|
+
if (this.style.barWidth > 0) {
|
|
6656
|
+
this.barWidth = Number(this.style.barWidth);
|
|
6657
|
+
this.barTotalWidth = this.barWidth * this.graph.barSeriesCount;
|
|
6658
|
+
} else {
|
|
6659
|
+
this.barTotalWidth = this.xAxis.width / count * (this.style.perWidth || 0.4);
|
|
6660
|
+
this.barWidth = this.barTotalWidth / this.graph.barSeriesCount;
|
|
6661
|
+
}
|
|
6659
6662
|
|
|
6660
6663
|
if (this.barWidth > maxWidth) {
|
|
6661
6664
|
this.barWidth = maxWidth;
|
|
6662
6665
|
this.barTotalWidth = maxWidth * this.graph.barSeriesCount;
|
|
6663
6666
|
}
|
|
6664
6667
|
}
|
|
6665
|
-
/**
|
|
6666
|
-
* 在图上加下定制图形
|
|
6667
|
-
* @param {jmShape} shape 图形
|
|
6668
|
+
/**
|
|
6669
|
+
* 在图上加下定制图形
|
|
6670
|
+
* @param {jmShape} shape 图形
|
|
6668
6671
|
*/
|
|
6669
6672
|
|
|
6670
6673
|
|
|
@@ -6676,14 +6679,14 @@ class jmBarSeries extends jmSeries {
|
|
|
6676
6679
|
|
|
6677
6680
|
}
|
|
6678
6681
|
|
|
6679
|
-
/**
|
|
6680
|
-
* 柱图
|
|
6681
|
-
*
|
|
6682
|
-
* @class jmBarSeries
|
|
6683
|
-
* @module jmChart
|
|
6684
|
-
* @param {jmChart} chart 当前图表
|
|
6685
|
-
* @param {array} mappings 图形字段映射
|
|
6686
|
-
* @param {style} style 样式
|
|
6682
|
+
/**
|
|
6683
|
+
* 柱图
|
|
6684
|
+
*
|
|
6685
|
+
* @class jmBarSeries
|
|
6686
|
+
* @module jmChart
|
|
6687
|
+
* @param {jmChart} chart 当前图表
|
|
6688
|
+
* @param {array} mappings 图形字段映射
|
|
6689
|
+
* @param {style} style 样式
|
|
6687
6690
|
*/
|
|
6688
6691
|
//构造函数
|
|
6689
6692
|
|
|
@@ -6691,11 +6694,11 @@ class jmStackBarSeries extends jmBarSeries {
|
|
|
6691
6694
|
constructor(options) {
|
|
6692
6695
|
super(options);
|
|
6693
6696
|
}
|
|
6694
|
-
/**
|
|
6695
|
-
* 绘制当前图形
|
|
6696
|
-
*
|
|
6697
|
-
* @method beginDraw
|
|
6698
|
-
* @for jmBarSeries
|
|
6697
|
+
/**
|
|
6698
|
+
* 绘制当前图形
|
|
6699
|
+
*
|
|
6700
|
+
* @method beginDraw
|
|
6701
|
+
* @for jmBarSeries
|
|
6699
6702
|
*/
|
|
6700
6703
|
|
|
6701
6704
|
|
|
@@ -6825,14 +6828,14 @@ class jmStackBarSeries extends jmBarSeries {
|
|
|
6825
6828
|
|
|
6826
6829
|
}
|
|
6827
6830
|
|
|
6828
|
-
/**
|
|
6829
|
-
* 饼图
|
|
6830
|
-
*
|
|
6831
|
-
* @class jmPieSeries
|
|
6832
|
-
* @module jmChart
|
|
6833
|
-
* @param {jmChart} chart 当前图表
|
|
6834
|
-
* @param {array} mappings 图形字段映射
|
|
6835
|
-
* @param {style} style 样式
|
|
6831
|
+
/**
|
|
6832
|
+
* 饼图
|
|
6833
|
+
*
|
|
6834
|
+
* @class jmPieSeries
|
|
6835
|
+
* @module jmChart
|
|
6836
|
+
* @param {jmChart} chart 当前图表
|
|
6837
|
+
* @param {array} mappings 图形字段映射
|
|
6838
|
+
* @param {style} style 样式
|
|
6836
6839
|
*/
|
|
6837
6840
|
//构造函数
|
|
6838
6841
|
|
|
@@ -6916,10 +6919,10 @@ class jmPieSeries extends jmSeries {
|
|
|
6916
6919
|
set startAngle(v) {
|
|
6917
6920
|
this.option.startAngle = v;
|
|
6918
6921
|
}
|
|
6919
|
-
/**
|
|
6920
|
-
* 生成序列图描点
|
|
6921
|
-
*
|
|
6922
|
-
* @method createPoints
|
|
6922
|
+
/**
|
|
6923
|
+
* 生成序列图描点
|
|
6924
|
+
*
|
|
6925
|
+
* @method createPoints
|
|
6923
6926
|
*/
|
|
6924
6927
|
|
|
6925
6928
|
|
|
@@ -7009,8 +7012,8 @@ class jmPieSeries extends jmSeries {
|
|
|
7009
7012
|
maxRadius: p.maxRadius,
|
|
7010
7013
|
minRadius: p.minRadius
|
|
7011
7014
|
});
|
|
7012
|
-
/**
|
|
7013
|
-
* 因为jmgraph是按图形形状来计算所占区域和大小的, 这里我们把扇形占区域改为整个图圆。这样计算大小和渐变时才好闭合。
|
|
7015
|
+
/**
|
|
7016
|
+
* 因为jmgraph是按图形形状来计算所占区域和大小的, 这里我们把扇形占区域改为整个图圆。这样计算大小和渐变时才好闭合。
|
|
7014
7017
|
*/
|
|
7015
7018
|
|
|
7016
7019
|
p.shape.getLocation = function () {
|
|
@@ -7119,10 +7122,10 @@ class jmPieSeries extends jmSeries {
|
|
|
7119
7122
|
}
|
|
7120
7123
|
|
|
7121
7124
|
}
|
|
7122
|
-
/**
|
|
7123
|
-
* 生成图例
|
|
7124
|
-
*
|
|
7125
|
-
* @method createLegend
|
|
7125
|
+
/**
|
|
7126
|
+
* 生成图例
|
|
7127
|
+
*
|
|
7128
|
+
* @method createLegend
|
|
7126
7129
|
*/
|
|
7127
7130
|
|
|
7128
7131
|
jmPieSeries.prototype.createLegend = function () {
|
|
@@ -7164,14 +7167,14 @@ jmPieSeries.prototype.createLegend = function () {
|
|
|
7164
7167
|
}
|
|
7165
7168
|
};
|
|
7166
7169
|
|
|
7167
|
-
/**
|
|
7168
|
-
* 图形基类
|
|
7169
|
-
*
|
|
7170
|
-
* @class jmLineSeries
|
|
7171
|
-
* @module jmChart
|
|
7172
|
-
* @param {jmChart} chart 当前图表
|
|
7173
|
-
* @param {array} mappings 图形字段映射
|
|
7174
|
-
* @param {style} style 样式
|
|
7170
|
+
/**
|
|
7171
|
+
* 图形基类
|
|
7172
|
+
*
|
|
7173
|
+
* @class jmLineSeries
|
|
7174
|
+
* @module jmChart
|
|
7175
|
+
* @param {jmChart} chart 当前图表
|
|
7176
|
+
* @param {array} mappings 图形字段映射
|
|
7177
|
+
* @param {style} style 样式
|
|
7175
7178
|
*/
|
|
7176
7179
|
//构造函数
|
|
7177
7180
|
|
|
@@ -7180,11 +7183,11 @@ class jmLineSeries extends jmSeries {
|
|
|
7180
7183
|
options.style = options.style || options.graph.style.line;
|
|
7181
7184
|
super(options); //this.on('beginDraw', this[PreDrawKey]);
|
|
7182
7185
|
}
|
|
7183
|
-
/**
|
|
7184
|
-
* 绘制图形前 初始化线条
|
|
7185
|
-
*
|
|
7186
|
-
* @method preDraw
|
|
7187
|
-
* @for jmLineSeries
|
|
7186
|
+
/**
|
|
7187
|
+
* 绘制图形前 初始化线条
|
|
7188
|
+
*
|
|
7189
|
+
* @method preDraw
|
|
7190
|
+
* @for jmLineSeries
|
|
7188
7191
|
*/
|
|
7189
7192
|
|
|
7190
7193
|
|
|
@@ -7235,8 +7238,8 @@ class jmLineSeries extends jmSeries {
|
|
|
7235
7238
|
shapePoints = this.createCurePoints(shapePoints, p);
|
|
7236
7239
|
} // 如果是虚线
|
|
7237
7240
|
else if (this.style.lineType === 'dotted') {
|
|
7238
|
-
|
|
7239
|
-
|
|
7241
|
+
shapePoints = this.createDotLine(shapePoints, p);
|
|
7242
|
+
}
|
|
7240
7243
|
|
|
7241
7244
|
shapePoints.push(p);
|
|
7242
7245
|
this.createItemLabel(p); // 生成关健值标注
|
|
@@ -7319,10 +7322,10 @@ class jmLineSeries extends jmSeries {
|
|
|
7319
7322
|
|
|
7320
7323
|
return shapePoints;
|
|
7321
7324
|
}
|
|
7322
|
-
/**
|
|
7323
|
-
* 生成图例
|
|
7324
|
-
*
|
|
7325
|
-
* @method createLegend
|
|
7325
|
+
/**
|
|
7326
|
+
* 生成图例
|
|
7327
|
+
*
|
|
7328
|
+
* @method createLegend
|
|
7326
7329
|
*/
|
|
7327
7330
|
|
|
7328
7331
|
|
|
@@ -7411,14 +7414,14 @@ class jmLineSeries extends jmSeries {
|
|
|
7411
7414
|
|
|
7412
7415
|
}
|
|
7413
7416
|
|
|
7414
|
-
/**
|
|
7415
|
-
* 二条线组成的区域图表
|
|
7416
|
-
*
|
|
7417
|
-
* @class jmStackLineSeries
|
|
7418
|
-
* @module jmChart
|
|
7419
|
-
* @param {jmChart} chart 当前图表
|
|
7420
|
-
* @param {array} mappings 图形字段映射
|
|
7421
|
-
* @param {style} style 样式
|
|
7417
|
+
/**
|
|
7418
|
+
* 二条线组成的区域图表
|
|
7419
|
+
*
|
|
7420
|
+
* @class jmStackLineSeries
|
|
7421
|
+
* @module jmChart
|
|
7422
|
+
* @param {jmChart} chart 当前图表
|
|
7423
|
+
* @param {array} mappings 图形字段映射
|
|
7424
|
+
* @param {style} style 样式
|
|
7422
7425
|
*/
|
|
7423
7426
|
//构造函数
|
|
7424
7427
|
|
|
@@ -7427,11 +7430,11 @@ class jmStackLineSeries extends jmLineSeries {
|
|
|
7427
7430
|
options.style = options.style || options.graph.style.stackLine;
|
|
7428
7431
|
super(options);
|
|
7429
7432
|
}
|
|
7430
|
-
/**
|
|
7431
|
-
* 绘制图形前 初始化线条
|
|
7432
|
-
*
|
|
7433
|
-
* @method preDraw
|
|
7434
|
-
* @for jmLineSeries
|
|
7433
|
+
/**
|
|
7434
|
+
* 绘制图形前 初始化线条
|
|
7435
|
+
*
|
|
7436
|
+
* @method preDraw
|
|
7437
|
+
* @for jmLineSeries
|
|
7435
7438
|
*/
|
|
7436
7439
|
|
|
7437
7440
|
|
|
@@ -7481,9 +7484,9 @@ class jmStackLineSeries extends jmLineSeries {
|
|
|
7481
7484
|
endShapePoints = this.createCurePoints(endShapePoints, p.points[1]);
|
|
7482
7485
|
} // 如果是虚线
|
|
7483
7486
|
else if (this.style.lineType === 'dotted') {
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
+
startShapePoints = this.createDotLine(startShapePoints, p.points[0]);
|
|
7488
|
+
endShapePoints = this.createDotLine(endShapePoints, p.points[1]);
|
|
7489
|
+
}
|
|
7487
7490
|
|
|
7488
7491
|
startShapePoints.push(p.points[0]);
|
|
7489
7492
|
endShapePoints.push(p.points[1]); // 生成标点的回调
|
|
@@ -7511,10 +7514,10 @@ class jmStackLineSeries extends jmLineSeries {
|
|
|
7511
7514
|
areaEnd.m = false;
|
|
7512
7515
|
this.createArea(areaPoints, false);
|
|
7513
7516
|
}
|
|
7514
|
-
/**
|
|
7515
|
-
* 生成图例
|
|
7516
|
-
*
|
|
7517
|
-
* @method createLegend
|
|
7517
|
+
/**
|
|
7518
|
+
* 生成图例
|
|
7519
|
+
*
|
|
7520
|
+
* @method createLegend
|
|
7518
7521
|
*/
|
|
7519
7522
|
|
|
7520
7523
|
|
|
@@ -7562,15 +7565,15 @@ class jmStackLineSeries extends jmLineSeries {
|
|
|
7562
7565
|
|
|
7563
7566
|
}
|
|
7564
7567
|
|
|
7565
|
-
/**
|
|
7566
|
-
* 轴
|
|
7567
|
-
*
|
|
7568
|
-
* @class jmAxis
|
|
7569
|
-
* @module jmChart
|
|
7570
|
-
* @param {jmChart} chart 当前图表
|
|
7571
|
-
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
7572
|
-
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
7573
|
-
* @param {object} [style] 样式
|
|
7568
|
+
/**
|
|
7569
|
+
* 轴
|
|
7570
|
+
*
|
|
7571
|
+
* @class jmAxis
|
|
7572
|
+
* @module jmChart
|
|
7573
|
+
* @param {jmChart} chart 当前图表
|
|
7574
|
+
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
7575
|
+
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
7576
|
+
* @param {object} [style] 样式
|
|
7574
7577
|
*/
|
|
7575
7578
|
|
|
7576
7579
|
class jmMarkLine extends jmLine {
|
|
@@ -7579,8 +7582,8 @@ class jmMarkLine extends jmLine {
|
|
|
7579
7582
|
this.visible = false;
|
|
7580
7583
|
this.markLineType = options.type || 'x'; // 为横轴x或纵轴y
|
|
7581
7584
|
|
|
7582
|
-
/**
|
|
7583
|
-
* 当前图形下的所有子图
|
|
7585
|
+
/**
|
|
7586
|
+
* 当前图形下的所有子图
|
|
7584
7587
|
*/
|
|
7585
7588
|
|
|
7586
7589
|
this.shapes = new jmList();
|
|
@@ -7660,9 +7663,9 @@ class jmMarkLine extends jmLine {
|
|
|
7660
7663
|
}, 10);
|
|
7661
7664
|
}
|
|
7662
7665
|
}
|
|
7663
|
-
/**
|
|
7664
|
-
* 移动标线
|
|
7665
|
-
* @param { object } args 移动事件参数
|
|
7666
|
+
/**
|
|
7667
|
+
* 移动标线
|
|
7668
|
+
* @param { object } args 移动事件参数
|
|
7666
7669
|
*/
|
|
7667
7670
|
|
|
7668
7671
|
|
|
@@ -7726,8 +7729,8 @@ class jmMarkLine extends jmLine {
|
|
|
7726
7729
|
this.needUpdate = true;
|
|
7727
7730
|
}
|
|
7728
7731
|
}
|
|
7729
|
-
/**
|
|
7730
|
-
* 中止
|
|
7732
|
+
/**
|
|
7733
|
+
* 中止
|
|
7731
7734
|
*/
|
|
7732
7735
|
|
|
7733
7736
|
|
|
@@ -7738,16 +7741,16 @@ class jmMarkLine extends jmLine {
|
|
|
7738
7741
|
|
|
7739
7742
|
}
|
|
7740
7743
|
|
|
7741
|
-
/**
|
|
7742
|
-
* jm图表组件
|
|
7743
|
-
* option参数:graph=jmgraph
|
|
7744
|
-
*
|
|
7745
|
-
* @class jmChart
|
|
7746
|
-
* @module jmChart
|
|
7747
|
-
* @param {element} container 图表容器
|
|
7744
|
+
/**
|
|
7745
|
+
* jm图表组件
|
|
7746
|
+
* option参数:graph=jmgraph
|
|
7747
|
+
*
|
|
7748
|
+
* @class jmChart
|
|
7749
|
+
* @module jmChart
|
|
7750
|
+
* @param {element} container 图表容器
|
|
7748
7751
|
*/
|
|
7749
7752
|
|
|
7750
|
-
class jmChart extends jmGraph {
|
|
7753
|
+
class jmChart extends jmGraph$1 {
|
|
7751
7754
|
constructor(container, options) {
|
|
7752
7755
|
options = options || {};
|
|
7753
7756
|
const enableAnimate = !!options.enableAnimate;
|
|
@@ -7773,13 +7776,13 @@ class jmChart extends jmGraph {
|
|
|
7773
7776
|
|
|
7774
7777
|
this.createTouchGraph(this.container, options);
|
|
7775
7778
|
}
|
|
7776
|
-
/**
|
|
7777
|
-
* 绑定的数据源
|
|
7779
|
+
/**
|
|
7780
|
+
* 绑定的数据源
|
|
7778
7781
|
*/
|
|
7779
7782
|
|
|
7780
7783
|
|
|
7781
|
-
/**
|
|
7782
|
-
* 是否启用动画
|
|
7784
|
+
/**
|
|
7785
|
+
* 是否启用动画
|
|
7783
7786
|
*/
|
|
7784
7787
|
get enableAnimate() {
|
|
7785
7788
|
if (typeof this.option.enableAnimate !== 'undefined') return !!this.option.enableAnimate;else {
|
|
@@ -7790,8 +7793,8 @@ class jmChart extends jmGraph {
|
|
|
7790
7793
|
set enableAnimate(v) {
|
|
7791
7794
|
this.option.enableAnimate = v;
|
|
7792
7795
|
}
|
|
7793
|
-
/**
|
|
7794
|
-
* Y轴的基线 默认是0
|
|
7796
|
+
/**
|
|
7797
|
+
* Y轴的基线 默认是0
|
|
7795
7798
|
*/
|
|
7796
7799
|
|
|
7797
7800
|
|
|
@@ -7805,11 +7808,11 @@ class jmChart extends jmGraph {
|
|
|
7805
7808
|
|
|
7806
7809
|
|
|
7807
7810
|
init(options) {
|
|
7808
|
-
/**
|
|
7809
|
-
* 绘图区域
|
|
7810
|
-
*
|
|
7811
|
-
* @property chartArea
|
|
7812
|
-
* @type jmControl
|
|
7811
|
+
/**
|
|
7812
|
+
* 绘图区域
|
|
7813
|
+
*
|
|
7814
|
+
* @property chartArea
|
|
7815
|
+
* @type jmControl
|
|
7813
7816
|
*/
|
|
7814
7817
|
if (!this.chartArea) {
|
|
7815
7818
|
this.chartArea = this.createShape('rect', {
|
|
@@ -7821,11 +7824,11 @@ class jmChart extends jmGraph {
|
|
|
7821
7824
|
});
|
|
7822
7825
|
this.children.add(this.chartArea);
|
|
7823
7826
|
}
|
|
7824
|
-
/**
|
|
7825
|
-
* 图例
|
|
7826
|
-
*
|
|
7827
|
-
* @property legend
|
|
7828
|
-
* @type jmLegend
|
|
7827
|
+
/**
|
|
7828
|
+
* 图例
|
|
7829
|
+
*
|
|
7830
|
+
* @property legend
|
|
7831
|
+
* @type jmLegend
|
|
7829
7832
|
*/
|
|
7830
7833
|
|
|
7831
7834
|
|
|
@@ -7837,11 +7840,11 @@ class jmChart extends jmGraph {
|
|
|
7837
7840
|
if (options.legendVisible === false) {
|
|
7838
7841
|
this.legend.visible = false;
|
|
7839
7842
|
}
|
|
7840
|
-
/**
|
|
7841
|
-
* 图表提示控件
|
|
7842
|
-
*
|
|
7843
|
-
* @property tooltip
|
|
7844
|
-
* @type jmTooltip
|
|
7843
|
+
/**
|
|
7844
|
+
* 图表提示控件
|
|
7845
|
+
*
|
|
7846
|
+
* @property tooltip
|
|
7847
|
+
* @type jmTooltip
|
|
7845
7848
|
*/
|
|
7846
7849
|
//this.tooltip = this.graph.createShape('tooltip',{style:this.style.tooltip});
|
|
7847
7850
|
//this.chartArea.children.add(this.tooltip);
|
|
@@ -7870,7 +7873,7 @@ class jmChart extends jmGraph {
|
|
|
7870
7873
|
cn.style.position = 'absolute';
|
|
7871
7874
|
cn.style.top = 0;
|
|
7872
7875
|
cn.style.left = 0;
|
|
7873
|
-
this.touchGraph = graph = new jmGraph(cn, options);
|
|
7876
|
+
this.touchGraph = graph = new jmGraph$1(cn, options);
|
|
7874
7877
|
container.appendChild(cn);
|
|
7875
7878
|
this.touchGraph.chartGraph = this;
|
|
7876
7879
|
this.on('propertyChange', (name, args) => {
|
|
@@ -7969,11 +7972,11 @@ class jmChart extends jmGraph {
|
|
|
7969
7972
|
delete this.yAxises;
|
|
7970
7973
|
}
|
|
7971
7974
|
}
|
|
7972
|
-
/**
|
|
7973
|
-
* 获取颜色
|
|
7974
|
-
*
|
|
7975
|
-
* @method getColor
|
|
7976
|
-
* @param {int} index 颜色索引
|
|
7975
|
+
/**
|
|
7976
|
+
* 获取颜色
|
|
7977
|
+
*
|
|
7978
|
+
* @method getColor
|
|
7979
|
+
* @param {int} index 颜色索引
|
|
7977
7980
|
*/
|
|
7978
7981
|
|
|
7979
7982
|
|
|
@@ -7985,11 +7988,11 @@ class jmChart extends jmGraph {
|
|
|
7985
7988
|
|
|
7986
7989
|
return this.style.chartColors[index];
|
|
7987
7990
|
}
|
|
7988
|
-
/**
|
|
7989
|
-
* 绘制当前图表
|
|
7990
|
-
* 先绘制轴等基础信息
|
|
7991
|
-
*
|
|
7992
|
-
* @method beginDraw
|
|
7991
|
+
/**
|
|
7992
|
+
* 绘制当前图表
|
|
7993
|
+
* 先绘制轴等基础信息
|
|
7994
|
+
*
|
|
7995
|
+
* @method beginDraw
|
|
7993
7996
|
*/
|
|
7994
7997
|
|
|
7995
7998
|
|
|
@@ -8054,10 +8057,10 @@ class jmChart extends jmGraph {
|
|
|
8054
8057
|
serie.init && serie.init();
|
|
8055
8058
|
}); //console.log('beginDraw4', Date.now() - startTime);
|
|
8056
8059
|
}
|
|
8057
|
-
/**
|
|
8058
|
-
* 重新定位区域的位置
|
|
8059
|
-
*
|
|
8060
|
-
* @method resetAreaPosition
|
|
8060
|
+
/**
|
|
8061
|
+
* 重新定位区域的位置
|
|
8062
|
+
*
|
|
8063
|
+
* @method resetAreaPosition
|
|
8061
8064
|
*/
|
|
8062
8065
|
|
|
8063
8066
|
|
|
@@ -8069,15 +8072,15 @@ class jmChart extends jmGraph {
|
|
|
8069
8072
|
this.chartArea.width = w;
|
|
8070
8073
|
this.chartArea.height = h;
|
|
8071
8074
|
}
|
|
8072
|
-
/**
|
|
8073
|
-
* 创建轴
|
|
8074
|
-
*
|
|
8075
|
-
* @method createAxis
|
|
8076
|
-
* @for jmChart
|
|
8077
|
-
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
8078
|
-
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
8079
|
-
* @param {object} [style] 样式
|
|
8080
|
-
* @return {axis} 轴
|
|
8075
|
+
/**
|
|
8076
|
+
* 创建轴
|
|
8077
|
+
*
|
|
8078
|
+
* @method createAxis
|
|
8079
|
+
* @for jmChart
|
|
8080
|
+
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
8081
|
+
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
8082
|
+
* @param {object} [style] 样式
|
|
8083
|
+
* @return {axis} 轴
|
|
8081
8084
|
*/
|
|
8082
8085
|
|
|
8083
8086
|
|
|
@@ -8089,12 +8092,12 @@ class jmChart extends jmGraph {
|
|
|
8089
8092
|
this.children.add(axis);
|
|
8090
8093
|
return axis;
|
|
8091
8094
|
}
|
|
8092
|
-
/**
|
|
8093
|
-
* 生成X轴
|
|
8094
|
-
*
|
|
8095
|
-
* @method createXAxis
|
|
8096
|
-
* @param {string} x轴的数据类型(string/number/date)
|
|
8097
|
-
* @param {bool} 是否从0开始
|
|
8095
|
+
/**
|
|
8096
|
+
* 生成X轴
|
|
8097
|
+
*
|
|
8098
|
+
* @method createXAxis
|
|
8099
|
+
* @param {string} x轴的数据类型(string/number/date)
|
|
8100
|
+
* @param {bool} 是否从0开始
|
|
8098
8101
|
*/
|
|
8099
8102
|
|
|
8100
8103
|
|
|
@@ -8121,13 +8124,13 @@ class jmChart extends jmGraph {
|
|
|
8121
8124
|
|
|
8122
8125
|
return this.xAxis;
|
|
8123
8126
|
}
|
|
8124
|
-
/**
|
|
8125
|
-
* 生成Y轴
|
|
8126
|
-
*
|
|
8127
|
-
* @method createYAxis
|
|
8128
|
-
* @param {int} Y轴索引,可以创建多个Y轴
|
|
8129
|
-
* @param {string} y轴的数据类型(string/number/date)
|
|
8130
|
-
* @param {bool} 是否从0开始
|
|
8127
|
+
/**
|
|
8128
|
+
* 生成Y轴
|
|
8129
|
+
*
|
|
8130
|
+
* @method createYAxis
|
|
8131
|
+
* @param {int} Y轴索引,可以创建多个Y轴
|
|
8132
|
+
* @param {string} y轴的数据类型(string/number/date)
|
|
8133
|
+
* @param {bool} 是否从0开始
|
|
8131
8134
|
*/
|
|
8132
8135
|
|
|
8133
8136
|
|
|
@@ -8156,14 +8159,14 @@ class jmChart extends jmGraph {
|
|
|
8156
8159
|
var yaxis = this.yAxises[options.index] || (this.yAxises[options.index] = this.createAxis(options));
|
|
8157
8160
|
return yaxis;
|
|
8158
8161
|
}
|
|
8159
|
-
/**
|
|
8160
|
-
* 创建图形
|
|
8161
|
-
*
|
|
8162
|
-
* @method createSeries
|
|
8163
|
-
* @for jmChart
|
|
8164
|
-
* @param {string} [type] 图类型,(line/bar/pie/radar)
|
|
8165
|
-
* @param {object} [options] 生成图表选项 {xField, yField, index}
|
|
8166
|
-
* @return {series} 图形
|
|
8162
|
+
/**
|
|
8163
|
+
* 创建图形
|
|
8164
|
+
*
|
|
8165
|
+
* @method createSeries
|
|
8166
|
+
* @for jmChart
|
|
8167
|
+
* @param {string} [type] 图类型,(line/bar/pie/radar)
|
|
8168
|
+
* @param {object} [options] 生成图表选项 {xField, yField, index}
|
|
8169
|
+
* @return {series} 图形
|
|
8167
8170
|
*/
|
|
8168
8171
|
|
|
8169
8172
|
|
|
@@ -8317,4 +8320,5 @@ var vchart = {
|
|
|
8317
8320
|
template: `<div ref="jmChartContainer" :style="{width: width, height: height}"></div>`
|
|
8318
8321
|
};
|
|
8319
8322
|
|
|
8320
|
-
export
|
|
8323
|
+
export default jmChart;
|
|
8324
|
+
export { jmChart, vchart as vChart };
|