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.cjs.js
CHANGED
|
@@ -3967,7 +3967,7 @@ class jmLabel extends jmControl {
|
|
|
3967
3967
|
|
|
3968
3968
|
//获取当前控件的绝对位置
|
|
3969
3969
|
let bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
|
|
3970
|
-
this.testSize();
|
|
3970
|
+
let size = this.testSize();
|
|
3971
3971
|
let location = this.location;
|
|
3972
3972
|
let x = location.left + bounds.left;
|
|
3973
3973
|
let y = location.top + bounds.top;
|
|
@@ -4411,7 +4411,7 @@ class jmMouseEvent {
|
|
|
4411
4411
|
|
|
4412
4412
|
this.eventEvents['mousedown'] = jmUtils.bindEvent(this.target,'mousedown',function(evt) {
|
|
4413
4413
|
evt = evt || window.event;
|
|
4414
|
-
container.raiseEvent('mousedown',evt);
|
|
4414
|
+
let r = container.raiseEvent('mousedown',evt);
|
|
4415
4415
|
//if(r === false) {
|
|
4416
4416
|
//if(evt.preventDefault) evt.preventDefault();
|
|
4417
4417
|
//return false;
|
|
@@ -4422,7 +4422,7 @@ class jmMouseEvent {
|
|
|
4422
4422
|
evt = evt || window.event;
|
|
4423
4423
|
let target = evt.target || evt.srcElement;
|
|
4424
4424
|
if(target == canvas) {
|
|
4425
|
-
container.raiseEvent('mousemove',evt);
|
|
4425
|
+
let r = container.raiseEvent('mousemove',evt);
|
|
4426
4426
|
//if(r === false) {
|
|
4427
4427
|
if(evt.preventDefault) evt.preventDefault();
|
|
4428
4428
|
return false;
|
|
@@ -4584,7 +4584,7 @@ class jmKeyEvent {
|
|
|
4584
4584
|
* @param {object} option 参数:{width:宽,height:高}
|
|
4585
4585
|
* @param {function} callback 初始化后的回调
|
|
4586
4586
|
*/
|
|
4587
|
-
class jmGraph
|
|
4587
|
+
class jmGraph extends jmControl {
|
|
4588
4588
|
|
|
4589
4589
|
constructor(canvas, option, callback) {
|
|
4590
4590
|
if(typeof option == 'function') {
|
|
@@ -4762,7 +4762,7 @@ class jmGraph$1 extends jmControl {
|
|
|
4762
4762
|
* @return {jmGraph} jmGraph实例对象
|
|
4763
4763
|
*/
|
|
4764
4764
|
static create(...args) {
|
|
4765
|
-
return new jmGraph
|
|
4765
|
+
return new jmGraph(...args);
|
|
4766
4766
|
}
|
|
4767
4767
|
|
|
4768
4768
|
/**
|
|
@@ -5108,7 +5108,7 @@ const shapes = {
|
|
|
5108
5108
|
"resize": jmResize
|
|
5109
5109
|
};
|
|
5110
5110
|
|
|
5111
|
-
class jmGraph extends jmGraph
|
|
5111
|
+
class jmGraph$1 extends jmGraph {
|
|
5112
5112
|
constructor(canvas, option, callback) {
|
|
5113
5113
|
|
|
5114
5114
|
const targetType = new.target;
|
|
@@ -5118,9 +5118,9 @@ class jmGraph extends jmGraph$1 {
|
|
|
5118
5118
|
option.shapes = Object.assign(shapes, option.shapes||{});
|
|
5119
5119
|
|
|
5120
5120
|
//不是用new实例化的话,返回一个promise
|
|
5121
|
-
if(!targetType || !(targetType.prototype instanceof jmGraph
|
|
5121
|
+
if(!targetType || !(targetType.prototype instanceof jmGraph)) {
|
|
5122
5122
|
return new Promise(function(resolve, reject){
|
|
5123
|
-
var g = new jmGraph(canvas, option, callback);
|
|
5123
|
+
var g = new jmGraph$1(canvas, option, callback);
|
|
5124
5124
|
if(resolve) resolve(g);
|
|
5125
5125
|
});
|
|
5126
5126
|
}
|
|
@@ -5134,12 +5134,12 @@ class jmGraph extends jmGraph$1 {
|
|
|
5134
5134
|
}
|
|
5135
5135
|
}
|
|
5136
5136
|
|
|
5137
|
-
/**
|
|
5138
|
-
* 基础样式
|
|
5139
|
-
*
|
|
5140
|
-
* @class jmChartStyle
|
|
5141
|
-
* @module jmChart
|
|
5142
|
-
* @static
|
|
5137
|
+
/**
|
|
5138
|
+
* 基础样式
|
|
5139
|
+
*
|
|
5140
|
+
* @class jmChartStyle
|
|
5141
|
+
* @module jmChart
|
|
5142
|
+
* @static
|
|
5143
5143
|
*/
|
|
5144
5144
|
var defaultStyle = {
|
|
5145
5145
|
layout: 'normal',
|
|
@@ -5275,13 +5275,13 @@ var defaultStyle = {
|
|
|
5275
5275
|
// 图形样式集
|
|
5276
5276
|
chartColors: ['#249FDA', '#EA3B7C', '#8EBC00', '#309B46', '#4B507E', '#D8E404', '#EB792A', '#A00DA0'],
|
|
5277
5277
|
|
|
5278
|
-
/*tooltip: {
|
|
5279
|
-
'background-color': 'rgb(255,255,255)',
|
|
5280
|
-
'padding':'4px',
|
|
5281
|
-
'opacity':'0.8',
|
|
5282
|
-
'border':'1px solid #000',
|
|
5283
|
-
'box-shadow': '0 0 3px #000',
|
|
5284
|
-
'border-radius': '6px'
|
|
5278
|
+
/*tooltip: {
|
|
5279
|
+
'background-color': 'rgb(255,255,255)',
|
|
5280
|
+
'padding':'4px',
|
|
5281
|
+
'opacity':'0.8',
|
|
5282
|
+
'border':'1px solid #000',
|
|
5283
|
+
'box-shadow': '0 0 3px #000',
|
|
5284
|
+
'border-radius': '6px'
|
|
5285
5285
|
},*/
|
|
5286
5286
|
line: {
|
|
5287
5287
|
normal: {
|
|
@@ -5391,15 +5391,15 @@ var defaultStyle = {
|
|
|
5391
5391
|
}
|
|
5392
5392
|
};
|
|
5393
5393
|
|
|
5394
|
-
/**
|
|
5395
|
-
* 轴
|
|
5396
|
-
*
|
|
5397
|
-
* @class jmAxis
|
|
5398
|
-
* @module jmChart
|
|
5399
|
-
* @param {jmChart} chart 当前图表
|
|
5400
|
-
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
5401
|
-
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
5402
|
-
* @param {object} [style] 样式
|
|
5394
|
+
/**
|
|
5395
|
+
* 轴
|
|
5396
|
+
*
|
|
5397
|
+
* @class jmAxis
|
|
5398
|
+
* @module jmChart
|
|
5399
|
+
* @param {jmChart} chart 当前图表
|
|
5400
|
+
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
5401
|
+
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
5402
|
+
* @param {object} [style] 样式
|
|
5403
5403
|
*/
|
|
5404
5404
|
|
|
5405
5405
|
class jmAxis extends jmArrowLine {
|
|
@@ -5451,16 +5451,16 @@ class jmAxis extends jmArrowLine {
|
|
|
5451
5451
|
if (typeof options.minYValue !== 'undefined') this.minValue = options.minYValue; // 最小值,如果指定了,则轴的最小值为它或更小的值
|
|
5452
5452
|
}
|
|
5453
5453
|
}
|
|
5454
|
-
/**
|
|
5455
|
-
* 轴类型(x/y/radar),默认为x
|
|
5456
|
-
*
|
|
5457
|
-
* @property type
|
|
5458
|
-
* @type string
|
|
5454
|
+
/**
|
|
5455
|
+
* 轴类型(x/y/radar),默认为x
|
|
5456
|
+
*
|
|
5457
|
+
* @property type
|
|
5458
|
+
* @type string
|
|
5459
5459
|
*/
|
|
5460
5460
|
|
|
5461
5461
|
|
|
5462
|
-
/**
|
|
5463
|
-
* 关联访问的是chart的数据源
|
|
5462
|
+
/**
|
|
5463
|
+
* 关联访问的是chart的数据源
|
|
5464
5464
|
*/
|
|
5465
5465
|
get data() {
|
|
5466
5466
|
return this.graph.data;
|
|
@@ -5469,10 +5469,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5469
5469
|
set data(d) {
|
|
5470
5470
|
this.graph.data = d;
|
|
5471
5471
|
}
|
|
5472
|
-
/**
|
|
5473
|
-
* 计算当前轴的位置
|
|
5474
|
-
*
|
|
5475
|
-
* @method reset
|
|
5472
|
+
/**
|
|
5473
|
+
* 计算当前轴的位置
|
|
5474
|
+
*
|
|
5475
|
+
* @method reset
|
|
5476
5476
|
*/
|
|
5477
5477
|
|
|
5478
5478
|
|
|
@@ -5530,10 +5530,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5530
5530
|
|
|
5531
5531
|
super.draw();
|
|
5532
5532
|
}
|
|
5533
|
-
/**
|
|
5534
|
-
* 生成轴标签
|
|
5535
|
-
*
|
|
5536
|
-
* @method createLabel
|
|
5533
|
+
/**
|
|
5534
|
+
* 生成轴标签
|
|
5535
|
+
*
|
|
5536
|
+
* @method createLabel
|
|
5537
5537
|
*/
|
|
5538
5538
|
|
|
5539
5539
|
|
|
@@ -5550,11 +5550,11 @@ class jmAxis extends jmArrowLine {
|
|
|
5550
5550
|
this.createYLabel();
|
|
5551
5551
|
}
|
|
5552
5552
|
}
|
|
5553
|
-
/**
|
|
5554
|
-
* 生成X轴标签
|
|
5555
|
-
*
|
|
5556
|
-
* @method createXLabel
|
|
5557
|
-
* @private
|
|
5553
|
+
/**
|
|
5554
|
+
* 生成X轴标签
|
|
5555
|
+
*
|
|
5556
|
+
* @method createXLabel
|
|
5557
|
+
* @private
|
|
5558
5558
|
*/
|
|
5559
5559
|
|
|
5560
5560
|
|
|
@@ -5645,11 +5645,11 @@ class jmAxis extends jmArrowLine {
|
|
|
5645
5645
|
}
|
|
5646
5646
|
}
|
|
5647
5647
|
}
|
|
5648
|
-
/**
|
|
5649
|
-
* 生成Y轴标签
|
|
5650
|
-
*
|
|
5651
|
-
* @method createYLabel
|
|
5652
|
-
* @private
|
|
5648
|
+
/**
|
|
5649
|
+
* 生成Y轴标签
|
|
5650
|
+
*
|
|
5651
|
+
* @method createYLabel
|
|
5652
|
+
* @private
|
|
5653
5653
|
*/
|
|
5654
5654
|
|
|
5655
5655
|
|
|
@@ -5662,8 +5662,8 @@ class jmAxis extends jmArrowLine {
|
|
|
5662
5662
|
|
|
5663
5663
|
let count = this.labelCount;
|
|
5664
5664
|
const mm = max - min;
|
|
5665
|
-
/*if(mm <= 10) {
|
|
5666
|
-
count = mm;
|
|
5665
|
+
/*if(mm <= 10) {
|
|
5666
|
+
count = mm;
|
|
5667
5667
|
}*/
|
|
5668
5668
|
// mm 放大10000倍,这里结果也需要除于10000
|
|
5669
5669
|
|
|
@@ -5775,10 +5775,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5775
5775
|
}
|
|
5776
5776
|
}
|
|
5777
5777
|
}
|
|
5778
|
-
/**
|
|
5779
|
-
* 获取当前轴所占宽
|
|
5780
|
-
*
|
|
5781
|
-
* @method width
|
|
5778
|
+
/**
|
|
5779
|
+
* 获取当前轴所占宽
|
|
5780
|
+
*
|
|
5781
|
+
* @method width
|
|
5782
5782
|
*/
|
|
5783
5783
|
|
|
5784
5784
|
|
|
@@ -5793,10 +5793,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5793
5793
|
set width(w) {
|
|
5794
5794
|
this._width = w;
|
|
5795
5795
|
}
|
|
5796
|
-
/**
|
|
5797
|
-
* 获取当前轴所占高
|
|
5798
|
-
*
|
|
5799
|
-
* @method height
|
|
5796
|
+
/**
|
|
5797
|
+
* 获取当前轴所占高
|
|
5798
|
+
*
|
|
5799
|
+
* @method height
|
|
5800
5800
|
*/
|
|
5801
5801
|
|
|
5802
5802
|
|
|
@@ -5806,12 +5806,12 @@ class jmAxis extends jmArrowLine {
|
|
|
5806
5806
|
|
|
5807
5807
|
|
|
5808
5808
|
set height(h) {}
|
|
5809
|
-
/**
|
|
5810
|
-
* 获取或设置当前轴最大值
|
|
5811
|
-
*
|
|
5812
|
-
* @method max
|
|
5813
|
-
* @param {number/date/string} 当前轴的最大值
|
|
5814
|
-
* @return 当前轴的最大值
|
|
5809
|
+
/**
|
|
5810
|
+
* 获取或设置当前轴最大值
|
|
5811
|
+
*
|
|
5812
|
+
* @method max
|
|
5813
|
+
* @param {number/date/string} 当前轴的最大值
|
|
5814
|
+
* @return 当前轴的最大值
|
|
5815
5815
|
*/
|
|
5816
5816
|
|
|
5817
5817
|
|
|
@@ -5860,12 +5860,12 @@ class jmAxis extends jmArrowLine {
|
|
|
5860
5860
|
|
|
5861
5861
|
return this._max;
|
|
5862
5862
|
}
|
|
5863
|
-
/**
|
|
5864
|
-
* 获取或设置当前轴最小值
|
|
5865
|
-
*
|
|
5866
|
-
* @method max
|
|
5867
|
-
* @param {number/date/string} 当前轴的最小值
|
|
5868
|
-
* @return 当前轴的最小值
|
|
5863
|
+
/**
|
|
5864
|
+
* 获取或设置当前轴最小值
|
|
5865
|
+
*
|
|
5866
|
+
* @method max
|
|
5867
|
+
* @param {number/date/string} 当前轴的最小值
|
|
5868
|
+
* @return 当前轴的最小值
|
|
5869
5869
|
*/
|
|
5870
5870
|
|
|
5871
5871
|
|
|
@@ -5912,10 +5912,10 @@ class jmAxis extends jmArrowLine {
|
|
|
5912
5912
|
|
|
5913
5913
|
return this.dataType == 'string' ? 0 : this._min;
|
|
5914
5914
|
}
|
|
5915
|
-
/**
|
|
5916
|
-
* 清除一些属性
|
|
5917
|
-
*
|
|
5918
|
-
* @method clear
|
|
5915
|
+
/**
|
|
5916
|
+
* 清除一些属性
|
|
5917
|
+
*
|
|
5918
|
+
* @method clear
|
|
5919
5919
|
*/
|
|
5920
5920
|
|
|
5921
5921
|
|
|
@@ -5923,11 +5923,11 @@ class jmAxis extends jmArrowLine {
|
|
|
5923
5923
|
this._min = null;
|
|
5924
5924
|
this._max = null;
|
|
5925
5925
|
}
|
|
5926
|
-
/**
|
|
5927
|
-
* 计算当前轴的单位偏移量
|
|
5928
|
-
*
|
|
5929
|
-
* @method step
|
|
5930
|
-
* @return {number} 单位偏移量
|
|
5926
|
+
/**
|
|
5927
|
+
* 计算当前轴的单位偏移量
|
|
5928
|
+
*
|
|
5929
|
+
* @method step
|
|
5930
|
+
* @return {number} 单位偏移量
|
|
5931
5931
|
*/
|
|
5932
5932
|
|
|
5933
5933
|
|
|
@@ -5976,12 +5976,12 @@ class jmAxis extends jmArrowLine {
|
|
|
5976
5976
|
|
|
5977
5977
|
}
|
|
5978
5978
|
|
|
5979
|
-
/**
|
|
5980
|
-
* 图例的容器
|
|
5981
|
-
*
|
|
5982
|
-
* @class jmLegend
|
|
5983
|
-
* @module jmChart
|
|
5984
|
-
* @param {jmChart} chart 当前图表
|
|
5979
|
+
/**
|
|
5980
|
+
* 图例的容器
|
|
5981
|
+
*
|
|
5982
|
+
* @class jmLegend
|
|
5983
|
+
* @module jmChart
|
|
5984
|
+
* @param {jmChart} chart 当前图表
|
|
5985
5985
|
*/
|
|
5986
5986
|
|
|
5987
5987
|
class jmLegend extends jmRect {
|
|
@@ -5995,18 +5995,18 @@ class jmLegend extends jmRect {
|
|
|
5995
5995
|
|
|
5996
5996
|
_defineProperty(this, "legendPosition", 'right');
|
|
5997
5997
|
}
|
|
5998
|
-
/**
|
|
5999
|
-
* 图例放置位置
|
|
5998
|
+
/**
|
|
5999
|
+
* 图例放置位置
|
|
6000
6000
|
*/
|
|
6001
6001
|
|
|
6002
6002
|
|
|
6003
6003
|
}
|
|
6004
|
-
/**
|
|
6005
|
-
* 添加图例
|
|
6006
|
-
*
|
|
6007
|
-
* @method append
|
|
6008
|
-
* @param {jmSeries} series 当前图序列
|
|
6009
|
-
* @param {jmControl} shape 当前图例的图形对象
|
|
6004
|
+
/**
|
|
6005
|
+
* 添加图例
|
|
6006
|
+
*
|
|
6007
|
+
* @method append
|
|
6008
|
+
* @param {jmSeries} series 当前图序列
|
|
6009
|
+
* @param {jmControl} shape 当前图例的图形对象
|
|
6010
6010
|
*/
|
|
6011
6011
|
|
|
6012
6012
|
jmLegend.prototype.append = function (series, shape, options = {}) {
|
|
@@ -6046,24 +6046,21 @@ jmLegend.prototype.append = function (series, shape, options = {}) {
|
|
|
6046
6046
|
panel.height = shape.height; //执行进入事件
|
|
6047
6047
|
//触动图例后加粗显示图
|
|
6048
6048
|
|
|
6049
|
-
/*const hover = options.hover || function() {
|
|
6050
|
-
//应用图的动态样式
|
|
6051
|
-
//Object.assign(series.style, series.style.hover);
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
//
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
//jmUtils.apply(this.series.style.normal,this.series.style);
|
|
6065
|
-
//series.graph.refresh();
|
|
6066
|
-
};
|
|
6049
|
+
/*const hover = options.hover || function() {
|
|
6050
|
+
//应用图的动态样式
|
|
6051
|
+
//Object.assign(series.style, series.style.hover);
|
|
6052
|
+
//Object.assign(this.style, this.style.hover || {});
|
|
6053
|
+
//series.graph.refresh();
|
|
6054
|
+
};
|
|
6055
|
+
panel.bind('mouseover', hover);
|
|
6056
|
+
//执行离开
|
|
6057
|
+
const leave = options.leave || function() {
|
|
6058
|
+
//应用图的普通样式
|
|
6059
|
+
//Object.assign(series.style, series.style.normal);
|
|
6060
|
+
//Object.assign(this.style, this.style.normal || {});
|
|
6061
|
+
//jmUtils.apply(this.series.style.normal,this.series.style);
|
|
6062
|
+
//series.graph.refresh();
|
|
6063
|
+
};
|
|
6067
6064
|
panel.bind('mouseleave', leave);*/
|
|
6068
6065
|
|
|
6069
6066
|
const legendPosition = this.legendPosition || this.style.legendPosition;
|
|
@@ -6083,10 +6080,10 @@ jmLegend.prototype.append = function (series, shape, options = {}) {
|
|
|
6083
6080
|
|
|
6084
6081
|
this.needUpdate = true;
|
|
6085
6082
|
};
|
|
6086
|
-
/**
|
|
6087
|
-
* 初始化图例
|
|
6088
|
-
*
|
|
6089
|
-
* @method init
|
|
6083
|
+
/**
|
|
6084
|
+
* 初始化图例
|
|
6085
|
+
*
|
|
6086
|
+
* @method init
|
|
6090
6087
|
*/
|
|
6091
6088
|
|
|
6092
6089
|
|
|
@@ -6098,10 +6095,10 @@ jmLegend.prototype.init = function () {
|
|
|
6098
6095
|
this.style.lineWidth = 0;
|
|
6099
6096
|
this.children.clear();
|
|
6100
6097
|
};
|
|
6101
|
-
/**
|
|
6102
|
-
* 重置图例属性,根据图例内容计算期大小并更新画图区域大小
|
|
6103
|
-
*
|
|
6104
|
-
* @method reset
|
|
6098
|
+
/**
|
|
6099
|
+
* 重置图例属性,根据图例内容计算期大小并更新画图区域大小
|
|
6100
|
+
*
|
|
6101
|
+
* @method reset
|
|
6105
6102
|
*/
|
|
6106
6103
|
|
|
6107
6104
|
|
|
@@ -6146,11 +6143,11 @@ jmLegend.prototype.reset = function () {
|
|
|
6146
6143
|
};
|
|
6147
6144
|
|
|
6148
6145
|
var utils = {
|
|
6149
|
-
/**
|
|
6150
|
-
* 对比二个数组数据是否改变
|
|
6151
|
-
* @param {Array} source 被对比的数、组
|
|
6152
|
-
* @param {Array} target 对比数组
|
|
6153
|
-
* @param {Function} compare 比较函数
|
|
6146
|
+
/**
|
|
6147
|
+
* 对比二个数组数据是否改变
|
|
6148
|
+
* @param {Array} source 被对比的数、组
|
|
6149
|
+
* @param {Array} target 对比数组
|
|
6150
|
+
* @param {Function} compare 比较函数
|
|
6154
6151
|
*/
|
|
6155
6152
|
arrayIsChange(source, target, compare) {
|
|
6156
6153
|
if (!source || !target) return true;
|
|
@@ -6167,14 +6164,14 @@ var utils = {
|
|
|
6167
6164
|
|
|
6168
6165
|
};
|
|
6169
6166
|
|
|
6170
|
-
/**
|
|
6171
|
-
* 图形基类
|
|
6172
|
-
*
|
|
6173
|
-
* @class jmSeries
|
|
6174
|
-
* @module jmChart
|
|
6175
|
-
* @param {jmChart} chart 当前图表
|
|
6176
|
-
* @param {array} mappings 图形字段映射
|
|
6177
|
-
* @param {style} style 样式
|
|
6167
|
+
/**
|
|
6168
|
+
* 图形基类
|
|
6169
|
+
*
|
|
6170
|
+
* @class jmSeries
|
|
6171
|
+
* @module jmChart
|
|
6172
|
+
* @param {jmChart} chart 当前图表
|
|
6173
|
+
* @param {array} mappings 图形字段映射
|
|
6174
|
+
* @param {style} style 样式
|
|
6178
6175
|
*/
|
|
6179
6176
|
//构造线图
|
|
6180
6177
|
|
|
@@ -6218,8 +6215,8 @@ class jmSeries extends jmPath {
|
|
|
6218
6215
|
maxYValue: options.maxYValue
|
|
6219
6216
|
});
|
|
6220
6217
|
}
|
|
6221
|
-
/**
|
|
6222
|
-
* 关联访问的是chart的数据源
|
|
6218
|
+
/**
|
|
6219
|
+
* 关联访问的是chart的数据源
|
|
6223
6220
|
*/
|
|
6224
6221
|
|
|
6225
6222
|
|
|
@@ -6241,11 +6238,11 @@ class jmSeries extends jmPath {
|
|
|
6241
6238
|
set enableAnimate(v) {
|
|
6242
6239
|
this.option.enableAnimate = v;
|
|
6243
6240
|
}
|
|
6244
|
-
/**
|
|
6245
|
-
* 图例名称
|
|
6246
|
-
*
|
|
6247
|
-
* @property legendLabel
|
|
6248
|
-
* @type string
|
|
6241
|
+
/**
|
|
6242
|
+
* 图例名称
|
|
6243
|
+
*
|
|
6244
|
+
* @property legendLabel
|
|
6245
|
+
* @type string
|
|
6249
6246
|
*/
|
|
6250
6247
|
|
|
6251
6248
|
|
|
@@ -6275,10 +6272,10 @@ class jmSeries extends jmPath {
|
|
|
6275
6272
|
points: this.dataPoints
|
|
6276
6273
|
};
|
|
6277
6274
|
}
|
|
6278
|
-
/**
|
|
6279
|
-
* 根据X轴坐标,获取它最近的数据描点
|
|
6280
|
-
* 离点最近的一个描点
|
|
6281
|
-
* @param {number} x X轴坐标
|
|
6275
|
+
/**
|
|
6276
|
+
* 根据X轴坐标,获取它最近的数据描点
|
|
6277
|
+
* 离点最近的一个描点
|
|
6278
|
+
* @param {number} x X轴坐标
|
|
6282
6279
|
*/
|
|
6283
6280
|
|
|
6284
6281
|
|
|
@@ -6298,7 +6295,7 @@ class jmSeries extends jmPath {
|
|
|
6298
6295
|
} // 下一个点
|
|
6299
6296
|
|
|
6300
6297
|
|
|
6301
|
-
if (p.x > x) {
|
|
6298
|
+
if ( p.x > x) {
|
|
6302
6299
|
// 没有上一个,只能返回这个了
|
|
6303
6300
|
if (prePoint && x - prePoint.x < p.x - x) return prePoint;else return p;
|
|
6304
6301
|
}
|
|
@@ -6306,9 +6303,9 @@ class jmSeries extends jmPath {
|
|
|
6306
6303
|
|
|
6307
6304
|
return null;
|
|
6308
6305
|
}
|
|
6309
|
-
/**
|
|
6310
|
-
* 根据X轴值获取数据点
|
|
6311
|
-
* @param {number} xValue X轴值
|
|
6306
|
+
/**
|
|
6307
|
+
* 根据X轴值获取数据点
|
|
6308
|
+
* @param {number} xValue X轴值
|
|
6312
6309
|
*/
|
|
6313
6310
|
|
|
6314
6311
|
|
|
@@ -6322,11 +6319,11 @@ class jmSeries extends jmPath {
|
|
|
6322
6319
|
|
|
6323
6320
|
return null;
|
|
6324
6321
|
}
|
|
6325
|
-
/**
|
|
6326
|
-
* 重置属性
|
|
6327
|
-
* 根据数据源计算轴的属性
|
|
6328
|
-
*
|
|
6329
|
-
* @method reset
|
|
6322
|
+
/**
|
|
6323
|
+
* 重置属性
|
|
6324
|
+
* 根据数据源计算轴的属性
|
|
6325
|
+
*
|
|
6326
|
+
* @method reset
|
|
6330
6327
|
*/
|
|
6331
6328
|
|
|
6332
6329
|
|
|
@@ -6370,10 +6367,10 @@ class jmSeries extends jmPath {
|
|
|
6370
6367
|
this.xAxis.min(xv);
|
|
6371
6368
|
}
|
|
6372
6369
|
}
|
|
6373
|
-
/**
|
|
6374
|
-
* 生成序列图描点
|
|
6375
|
-
*
|
|
6376
|
-
* @method createPoints
|
|
6370
|
+
/**
|
|
6371
|
+
* 生成序列图描点
|
|
6372
|
+
*
|
|
6373
|
+
* @method createPoints
|
|
6377
6374
|
*/
|
|
6378
6375
|
|
|
6379
6376
|
|
|
@@ -6450,10 +6447,10 @@ class jmSeries extends jmPath {
|
|
|
6450
6447
|
return this.style.color;
|
|
6451
6448
|
}
|
|
6452
6449
|
}
|
|
6453
|
-
/**
|
|
6454
|
-
* 生成图例
|
|
6455
|
-
*
|
|
6456
|
-
* @method createLegend
|
|
6450
|
+
/**
|
|
6451
|
+
* 生成图例
|
|
6452
|
+
*
|
|
6453
|
+
* @method createLegend
|
|
6457
6454
|
*/
|
|
6458
6455
|
|
|
6459
6456
|
|
|
@@ -6505,9 +6502,9 @@ class jmSeries extends jmPath {
|
|
|
6505
6502
|
});
|
|
6506
6503
|
this.addShape(label);
|
|
6507
6504
|
}
|
|
6508
|
-
/**
|
|
6509
|
-
* 在图上加下定制图形
|
|
6510
|
-
* @param {jmShape} shape 图形
|
|
6505
|
+
/**
|
|
6506
|
+
* 在图上加下定制图形
|
|
6507
|
+
* @param {jmShape} shape 图形
|
|
6511
6508
|
*/
|
|
6512
6509
|
|
|
6513
6510
|
|
|
@@ -6516,13 +6513,13 @@ class jmSeries extends jmPath {
|
|
|
6516
6513
|
this.shapes.add(shape);
|
|
6517
6514
|
return shape;
|
|
6518
6515
|
}
|
|
6519
|
-
/**
|
|
6520
|
-
* 获取指定事件的集合
|
|
6521
|
-
* 比如mousedown,mouseup等
|
|
6522
|
-
*
|
|
6523
|
-
* @method getEvent
|
|
6524
|
-
* @param {string} name 事件名称
|
|
6525
|
-
* @return {list} 事件委托的集合
|
|
6516
|
+
/**
|
|
6517
|
+
* 获取指定事件的集合
|
|
6518
|
+
* 比如mousedown,mouseup等
|
|
6519
|
+
*
|
|
6520
|
+
* @method getEvent
|
|
6521
|
+
* @param {string} name 事件名称
|
|
6522
|
+
* @return {list} 事件委托的集合
|
|
6526
6523
|
*/
|
|
6527
6524
|
|
|
6528
6525
|
|
|
@@ -6546,14 +6543,14 @@ class jmSeries extends jmPath {
|
|
|
6546
6543
|
|
|
6547
6544
|
}
|
|
6548
6545
|
|
|
6549
|
-
/**
|
|
6550
|
-
* 柱图
|
|
6551
|
-
*
|
|
6552
|
-
* @class jmBarSeries
|
|
6553
|
-
* @module jmChart
|
|
6554
|
-
* @param {jmChart} chart 当前图表
|
|
6555
|
-
* @param {array} mappings 图形字段映射
|
|
6556
|
-
* @param {style} style 样式
|
|
6546
|
+
/**
|
|
6547
|
+
* 柱图
|
|
6548
|
+
*
|
|
6549
|
+
* @class jmBarSeries
|
|
6550
|
+
* @module jmChart
|
|
6551
|
+
* @param {jmChart} chart 当前图表
|
|
6552
|
+
* @param {array} mappings 图形字段映射
|
|
6553
|
+
* @param {style} style 样式
|
|
6557
6554
|
*/
|
|
6558
6555
|
//构造函数
|
|
6559
6556
|
|
|
@@ -6561,11 +6558,11 @@ class jmBarSeries extends jmSeries {
|
|
|
6561
6558
|
constructor(options) {
|
|
6562
6559
|
super(options);
|
|
6563
6560
|
}
|
|
6564
|
-
/**
|
|
6565
|
-
* 绘制当前图形
|
|
6566
|
-
*
|
|
6567
|
-
* @method beginDraw
|
|
6568
|
-
* @for jmBarSeries
|
|
6561
|
+
/**
|
|
6562
|
+
* 绘制当前图形
|
|
6563
|
+
*
|
|
6564
|
+
* @method beginDraw
|
|
6565
|
+
* @for jmBarSeries
|
|
6569
6566
|
*/
|
|
6570
6567
|
|
|
6571
6568
|
|
|
@@ -6658,17 +6655,23 @@ class jmBarSeries extends jmSeries {
|
|
|
6658
6655
|
//计算每个柱子占宽
|
|
6659
6656
|
//每项柱子占宽除以柱子个数,默认最大宽度为30
|
|
6660
6657
|
const maxWidth = this.xAxis.width / count / this.graph.barSeriesCount;
|
|
6661
|
-
|
|
6662
|
-
this.barWidth
|
|
6658
|
+
|
|
6659
|
+
if (this.style.barWidth > 0) {
|
|
6660
|
+
this.barWidth = Number(this.style.barWidth);
|
|
6661
|
+
this.barTotalWidth = this.barWidth * this.graph.barSeriesCount;
|
|
6662
|
+
} else {
|
|
6663
|
+
this.barTotalWidth = this.xAxis.width / count * (this.style.perWidth || 0.4);
|
|
6664
|
+
this.barWidth = this.barTotalWidth / this.graph.barSeriesCount;
|
|
6665
|
+
}
|
|
6663
6666
|
|
|
6664
6667
|
if (this.barWidth > maxWidth) {
|
|
6665
6668
|
this.barWidth = maxWidth;
|
|
6666
6669
|
this.barTotalWidth = maxWidth * this.graph.barSeriesCount;
|
|
6667
6670
|
}
|
|
6668
6671
|
}
|
|
6669
|
-
/**
|
|
6670
|
-
* 在图上加下定制图形
|
|
6671
|
-
* @param {jmShape} shape 图形
|
|
6672
|
+
/**
|
|
6673
|
+
* 在图上加下定制图形
|
|
6674
|
+
* @param {jmShape} shape 图形
|
|
6672
6675
|
*/
|
|
6673
6676
|
|
|
6674
6677
|
|
|
@@ -6680,14 +6683,14 @@ class jmBarSeries extends jmSeries {
|
|
|
6680
6683
|
|
|
6681
6684
|
}
|
|
6682
6685
|
|
|
6683
|
-
/**
|
|
6684
|
-
* 柱图
|
|
6685
|
-
*
|
|
6686
|
-
* @class jmBarSeries
|
|
6687
|
-
* @module jmChart
|
|
6688
|
-
* @param {jmChart} chart 当前图表
|
|
6689
|
-
* @param {array} mappings 图形字段映射
|
|
6690
|
-
* @param {style} style 样式
|
|
6686
|
+
/**
|
|
6687
|
+
* 柱图
|
|
6688
|
+
*
|
|
6689
|
+
* @class jmBarSeries
|
|
6690
|
+
* @module jmChart
|
|
6691
|
+
* @param {jmChart} chart 当前图表
|
|
6692
|
+
* @param {array} mappings 图形字段映射
|
|
6693
|
+
* @param {style} style 样式
|
|
6691
6694
|
*/
|
|
6692
6695
|
//构造函数
|
|
6693
6696
|
|
|
@@ -6695,11 +6698,11 @@ class jmStackBarSeries extends jmBarSeries {
|
|
|
6695
6698
|
constructor(options) {
|
|
6696
6699
|
super(options);
|
|
6697
6700
|
}
|
|
6698
|
-
/**
|
|
6699
|
-
* 绘制当前图形
|
|
6700
|
-
*
|
|
6701
|
-
* @method beginDraw
|
|
6702
|
-
* @for jmBarSeries
|
|
6701
|
+
/**
|
|
6702
|
+
* 绘制当前图形
|
|
6703
|
+
*
|
|
6704
|
+
* @method beginDraw
|
|
6705
|
+
* @for jmBarSeries
|
|
6703
6706
|
*/
|
|
6704
6707
|
|
|
6705
6708
|
|
|
@@ -6829,14 +6832,14 @@ class jmStackBarSeries extends jmBarSeries {
|
|
|
6829
6832
|
|
|
6830
6833
|
}
|
|
6831
6834
|
|
|
6832
|
-
/**
|
|
6833
|
-
* 饼图
|
|
6834
|
-
*
|
|
6835
|
-
* @class jmPieSeries
|
|
6836
|
-
* @module jmChart
|
|
6837
|
-
* @param {jmChart} chart 当前图表
|
|
6838
|
-
* @param {array} mappings 图形字段映射
|
|
6839
|
-
* @param {style} style 样式
|
|
6835
|
+
/**
|
|
6836
|
+
* 饼图
|
|
6837
|
+
*
|
|
6838
|
+
* @class jmPieSeries
|
|
6839
|
+
* @module jmChart
|
|
6840
|
+
* @param {jmChart} chart 当前图表
|
|
6841
|
+
* @param {array} mappings 图形字段映射
|
|
6842
|
+
* @param {style} style 样式
|
|
6840
6843
|
*/
|
|
6841
6844
|
//构造函数
|
|
6842
6845
|
|
|
@@ -6920,10 +6923,10 @@ class jmPieSeries extends jmSeries {
|
|
|
6920
6923
|
set startAngle(v) {
|
|
6921
6924
|
this.option.startAngle = v;
|
|
6922
6925
|
}
|
|
6923
|
-
/**
|
|
6924
|
-
* 生成序列图描点
|
|
6925
|
-
*
|
|
6926
|
-
* @method createPoints
|
|
6926
|
+
/**
|
|
6927
|
+
* 生成序列图描点
|
|
6928
|
+
*
|
|
6929
|
+
* @method createPoints
|
|
6927
6930
|
*/
|
|
6928
6931
|
|
|
6929
6932
|
|
|
@@ -7013,8 +7016,8 @@ class jmPieSeries extends jmSeries {
|
|
|
7013
7016
|
maxRadius: p.maxRadius,
|
|
7014
7017
|
minRadius: p.minRadius
|
|
7015
7018
|
});
|
|
7016
|
-
/**
|
|
7017
|
-
* 因为jmgraph是按图形形状来计算所占区域和大小的, 这里我们把扇形占区域改为整个图圆。这样计算大小和渐变时才好闭合。
|
|
7019
|
+
/**
|
|
7020
|
+
* 因为jmgraph是按图形形状来计算所占区域和大小的, 这里我们把扇形占区域改为整个图圆。这样计算大小和渐变时才好闭合。
|
|
7018
7021
|
*/
|
|
7019
7022
|
|
|
7020
7023
|
p.shape.getLocation = function () {
|
|
@@ -7123,10 +7126,10 @@ class jmPieSeries extends jmSeries {
|
|
|
7123
7126
|
}
|
|
7124
7127
|
|
|
7125
7128
|
}
|
|
7126
|
-
/**
|
|
7127
|
-
* 生成图例
|
|
7128
|
-
*
|
|
7129
|
-
* @method createLegend
|
|
7129
|
+
/**
|
|
7130
|
+
* 生成图例
|
|
7131
|
+
*
|
|
7132
|
+
* @method createLegend
|
|
7130
7133
|
*/
|
|
7131
7134
|
|
|
7132
7135
|
jmPieSeries.prototype.createLegend = function () {
|
|
@@ -7168,14 +7171,14 @@ jmPieSeries.prototype.createLegend = function () {
|
|
|
7168
7171
|
}
|
|
7169
7172
|
};
|
|
7170
7173
|
|
|
7171
|
-
/**
|
|
7172
|
-
* 图形基类
|
|
7173
|
-
*
|
|
7174
|
-
* @class jmLineSeries
|
|
7175
|
-
* @module jmChart
|
|
7176
|
-
* @param {jmChart} chart 当前图表
|
|
7177
|
-
* @param {array} mappings 图形字段映射
|
|
7178
|
-
* @param {style} style 样式
|
|
7174
|
+
/**
|
|
7175
|
+
* 图形基类
|
|
7176
|
+
*
|
|
7177
|
+
* @class jmLineSeries
|
|
7178
|
+
* @module jmChart
|
|
7179
|
+
* @param {jmChart} chart 当前图表
|
|
7180
|
+
* @param {array} mappings 图形字段映射
|
|
7181
|
+
* @param {style} style 样式
|
|
7179
7182
|
*/
|
|
7180
7183
|
//构造函数
|
|
7181
7184
|
|
|
@@ -7184,11 +7187,11 @@ class jmLineSeries extends jmSeries {
|
|
|
7184
7187
|
options.style = options.style || options.graph.style.line;
|
|
7185
7188
|
super(options); //this.on('beginDraw', this[PreDrawKey]);
|
|
7186
7189
|
}
|
|
7187
|
-
/**
|
|
7188
|
-
* 绘制图形前 初始化线条
|
|
7189
|
-
*
|
|
7190
|
-
* @method preDraw
|
|
7191
|
-
* @for jmLineSeries
|
|
7190
|
+
/**
|
|
7191
|
+
* 绘制图形前 初始化线条
|
|
7192
|
+
*
|
|
7193
|
+
* @method preDraw
|
|
7194
|
+
* @for jmLineSeries
|
|
7192
7195
|
*/
|
|
7193
7196
|
|
|
7194
7197
|
|
|
@@ -7239,8 +7242,8 @@ class jmLineSeries extends jmSeries {
|
|
|
7239
7242
|
shapePoints = this.createCurePoints(shapePoints, p);
|
|
7240
7243
|
} // 如果是虚线
|
|
7241
7244
|
else if (this.style.lineType === 'dotted') {
|
|
7242
|
-
|
|
7243
|
-
|
|
7245
|
+
shapePoints = this.createDotLine(shapePoints, p);
|
|
7246
|
+
}
|
|
7244
7247
|
|
|
7245
7248
|
shapePoints.push(p);
|
|
7246
7249
|
this.createItemLabel(p); // 生成关健值标注
|
|
@@ -7323,10 +7326,10 @@ class jmLineSeries extends jmSeries {
|
|
|
7323
7326
|
|
|
7324
7327
|
return shapePoints;
|
|
7325
7328
|
}
|
|
7326
|
-
/**
|
|
7327
|
-
* 生成图例
|
|
7328
|
-
*
|
|
7329
|
-
* @method createLegend
|
|
7329
|
+
/**
|
|
7330
|
+
* 生成图例
|
|
7331
|
+
*
|
|
7332
|
+
* @method createLegend
|
|
7330
7333
|
*/
|
|
7331
7334
|
|
|
7332
7335
|
|
|
@@ -7415,14 +7418,14 @@ class jmLineSeries extends jmSeries {
|
|
|
7415
7418
|
|
|
7416
7419
|
}
|
|
7417
7420
|
|
|
7418
|
-
/**
|
|
7419
|
-
* 二条线组成的区域图表
|
|
7420
|
-
*
|
|
7421
|
-
* @class jmStackLineSeries
|
|
7422
|
-
* @module jmChart
|
|
7423
|
-
* @param {jmChart} chart 当前图表
|
|
7424
|
-
* @param {array} mappings 图形字段映射
|
|
7425
|
-
* @param {style} style 样式
|
|
7421
|
+
/**
|
|
7422
|
+
* 二条线组成的区域图表
|
|
7423
|
+
*
|
|
7424
|
+
* @class jmStackLineSeries
|
|
7425
|
+
* @module jmChart
|
|
7426
|
+
* @param {jmChart} chart 当前图表
|
|
7427
|
+
* @param {array} mappings 图形字段映射
|
|
7428
|
+
* @param {style} style 样式
|
|
7426
7429
|
*/
|
|
7427
7430
|
//构造函数
|
|
7428
7431
|
|
|
@@ -7431,11 +7434,11 @@ class jmStackLineSeries extends jmLineSeries {
|
|
|
7431
7434
|
options.style = options.style || options.graph.style.stackLine;
|
|
7432
7435
|
super(options);
|
|
7433
7436
|
}
|
|
7434
|
-
/**
|
|
7435
|
-
* 绘制图形前 初始化线条
|
|
7436
|
-
*
|
|
7437
|
-
* @method preDraw
|
|
7438
|
-
* @for jmLineSeries
|
|
7437
|
+
/**
|
|
7438
|
+
* 绘制图形前 初始化线条
|
|
7439
|
+
*
|
|
7440
|
+
* @method preDraw
|
|
7441
|
+
* @for jmLineSeries
|
|
7439
7442
|
*/
|
|
7440
7443
|
|
|
7441
7444
|
|
|
@@ -7485,9 +7488,9 @@ class jmStackLineSeries extends jmLineSeries {
|
|
|
7485
7488
|
endShapePoints = this.createCurePoints(endShapePoints, p.points[1]);
|
|
7486
7489
|
} // 如果是虚线
|
|
7487
7490
|
else if (this.style.lineType === 'dotted') {
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
+
startShapePoints = this.createDotLine(startShapePoints, p.points[0]);
|
|
7492
|
+
endShapePoints = this.createDotLine(endShapePoints, p.points[1]);
|
|
7493
|
+
}
|
|
7491
7494
|
|
|
7492
7495
|
startShapePoints.push(p.points[0]);
|
|
7493
7496
|
endShapePoints.push(p.points[1]); // 生成标点的回调
|
|
@@ -7515,10 +7518,10 @@ class jmStackLineSeries extends jmLineSeries {
|
|
|
7515
7518
|
areaEnd.m = false;
|
|
7516
7519
|
this.createArea(areaPoints, false);
|
|
7517
7520
|
}
|
|
7518
|
-
/**
|
|
7519
|
-
* 生成图例
|
|
7520
|
-
*
|
|
7521
|
-
* @method createLegend
|
|
7521
|
+
/**
|
|
7522
|
+
* 生成图例
|
|
7523
|
+
*
|
|
7524
|
+
* @method createLegend
|
|
7522
7525
|
*/
|
|
7523
7526
|
|
|
7524
7527
|
|
|
@@ -7566,15 +7569,15 @@ class jmStackLineSeries extends jmLineSeries {
|
|
|
7566
7569
|
|
|
7567
7570
|
}
|
|
7568
7571
|
|
|
7569
|
-
/**
|
|
7570
|
-
* 轴
|
|
7571
|
-
*
|
|
7572
|
-
* @class jmAxis
|
|
7573
|
-
* @module jmChart
|
|
7574
|
-
* @param {jmChart} chart 当前图表
|
|
7575
|
-
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
7576
|
-
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
7577
|
-
* @param {object} [style] 样式
|
|
7572
|
+
/**
|
|
7573
|
+
* 轴
|
|
7574
|
+
*
|
|
7575
|
+
* @class jmAxis
|
|
7576
|
+
* @module jmChart
|
|
7577
|
+
* @param {jmChart} chart 当前图表
|
|
7578
|
+
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
7579
|
+
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
7580
|
+
* @param {object} [style] 样式
|
|
7578
7581
|
*/
|
|
7579
7582
|
|
|
7580
7583
|
class jmMarkLine extends jmLine {
|
|
@@ -7583,8 +7586,8 @@ class jmMarkLine extends jmLine {
|
|
|
7583
7586
|
this.visible = false;
|
|
7584
7587
|
this.markLineType = options.type || 'x'; // 为横轴x或纵轴y
|
|
7585
7588
|
|
|
7586
|
-
/**
|
|
7587
|
-
* 当前图形下的所有子图
|
|
7589
|
+
/**
|
|
7590
|
+
* 当前图形下的所有子图
|
|
7588
7591
|
*/
|
|
7589
7592
|
|
|
7590
7593
|
this.shapes = new jmList();
|
|
@@ -7664,9 +7667,9 @@ class jmMarkLine extends jmLine {
|
|
|
7664
7667
|
}, 10);
|
|
7665
7668
|
}
|
|
7666
7669
|
}
|
|
7667
|
-
/**
|
|
7668
|
-
* 移动标线
|
|
7669
|
-
* @param { object } args 移动事件参数
|
|
7670
|
+
/**
|
|
7671
|
+
* 移动标线
|
|
7672
|
+
* @param { object } args 移动事件参数
|
|
7670
7673
|
*/
|
|
7671
7674
|
|
|
7672
7675
|
|
|
@@ -7730,8 +7733,8 @@ class jmMarkLine extends jmLine {
|
|
|
7730
7733
|
this.needUpdate = true;
|
|
7731
7734
|
}
|
|
7732
7735
|
}
|
|
7733
|
-
/**
|
|
7734
|
-
* 中止
|
|
7736
|
+
/**
|
|
7737
|
+
* 中止
|
|
7735
7738
|
*/
|
|
7736
7739
|
|
|
7737
7740
|
|
|
@@ -7742,16 +7745,16 @@ class jmMarkLine extends jmLine {
|
|
|
7742
7745
|
|
|
7743
7746
|
}
|
|
7744
7747
|
|
|
7745
|
-
/**
|
|
7746
|
-
* jm图表组件
|
|
7747
|
-
* option参数:graph=jmgraph
|
|
7748
|
-
*
|
|
7749
|
-
* @class jmChart
|
|
7750
|
-
* @module jmChart
|
|
7751
|
-
* @param {element} container 图表容器
|
|
7748
|
+
/**
|
|
7749
|
+
* jm图表组件
|
|
7750
|
+
* option参数:graph=jmgraph
|
|
7751
|
+
*
|
|
7752
|
+
* @class jmChart
|
|
7753
|
+
* @module jmChart
|
|
7754
|
+
* @param {element} container 图表容器
|
|
7752
7755
|
*/
|
|
7753
7756
|
|
|
7754
|
-
class jmChart extends jmGraph {
|
|
7757
|
+
class jmChart extends jmGraph$1 {
|
|
7755
7758
|
constructor(container, options) {
|
|
7756
7759
|
options = options || {};
|
|
7757
7760
|
const enableAnimate = !!options.enableAnimate;
|
|
@@ -7777,13 +7780,13 @@ class jmChart extends jmGraph {
|
|
|
7777
7780
|
|
|
7778
7781
|
this.createTouchGraph(this.container, options);
|
|
7779
7782
|
}
|
|
7780
|
-
/**
|
|
7781
|
-
* 绑定的数据源
|
|
7783
|
+
/**
|
|
7784
|
+
* 绑定的数据源
|
|
7782
7785
|
*/
|
|
7783
7786
|
|
|
7784
7787
|
|
|
7785
|
-
/**
|
|
7786
|
-
* 是否启用动画
|
|
7788
|
+
/**
|
|
7789
|
+
* 是否启用动画
|
|
7787
7790
|
*/
|
|
7788
7791
|
get enableAnimate() {
|
|
7789
7792
|
if (typeof this.option.enableAnimate !== 'undefined') return !!this.option.enableAnimate;else {
|
|
@@ -7794,8 +7797,8 @@ class jmChart extends jmGraph {
|
|
|
7794
7797
|
set enableAnimate(v) {
|
|
7795
7798
|
this.option.enableAnimate = v;
|
|
7796
7799
|
}
|
|
7797
|
-
/**
|
|
7798
|
-
* Y轴的基线 默认是0
|
|
7800
|
+
/**
|
|
7801
|
+
* Y轴的基线 默认是0
|
|
7799
7802
|
*/
|
|
7800
7803
|
|
|
7801
7804
|
|
|
@@ -7809,11 +7812,11 @@ class jmChart extends jmGraph {
|
|
|
7809
7812
|
|
|
7810
7813
|
|
|
7811
7814
|
init(options) {
|
|
7812
|
-
/**
|
|
7813
|
-
* 绘图区域
|
|
7814
|
-
*
|
|
7815
|
-
* @property chartArea
|
|
7816
|
-
* @type jmControl
|
|
7815
|
+
/**
|
|
7816
|
+
* 绘图区域
|
|
7817
|
+
*
|
|
7818
|
+
* @property chartArea
|
|
7819
|
+
* @type jmControl
|
|
7817
7820
|
*/
|
|
7818
7821
|
if (!this.chartArea) {
|
|
7819
7822
|
this.chartArea = this.createShape('rect', {
|
|
@@ -7825,11 +7828,11 @@ class jmChart extends jmGraph {
|
|
|
7825
7828
|
});
|
|
7826
7829
|
this.children.add(this.chartArea);
|
|
7827
7830
|
}
|
|
7828
|
-
/**
|
|
7829
|
-
* 图例
|
|
7830
|
-
*
|
|
7831
|
-
* @property legend
|
|
7832
|
-
* @type jmLegend
|
|
7831
|
+
/**
|
|
7832
|
+
* 图例
|
|
7833
|
+
*
|
|
7834
|
+
* @property legend
|
|
7835
|
+
* @type jmLegend
|
|
7833
7836
|
*/
|
|
7834
7837
|
|
|
7835
7838
|
|
|
@@ -7841,11 +7844,11 @@ class jmChart extends jmGraph {
|
|
|
7841
7844
|
if (options.legendVisible === false) {
|
|
7842
7845
|
this.legend.visible = false;
|
|
7843
7846
|
}
|
|
7844
|
-
/**
|
|
7845
|
-
* 图表提示控件
|
|
7846
|
-
*
|
|
7847
|
-
* @property tooltip
|
|
7848
|
-
* @type jmTooltip
|
|
7847
|
+
/**
|
|
7848
|
+
* 图表提示控件
|
|
7849
|
+
*
|
|
7850
|
+
* @property tooltip
|
|
7851
|
+
* @type jmTooltip
|
|
7849
7852
|
*/
|
|
7850
7853
|
//this.tooltip = this.graph.createShape('tooltip',{style:this.style.tooltip});
|
|
7851
7854
|
//this.chartArea.children.add(this.tooltip);
|
|
@@ -7874,7 +7877,7 @@ class jmChart extends jmGraph {
|
|
|
7874
7877
|
cn.style.position = 'absolute';
|
|
7875
7878
|
cn.style.top = 0;
|
|
7876
7879
|
cn.style.left = 0;
|
|
7877
|
-
this.touchGraph = graph = new jmGraph(cn, options);
|
|
7880
|
+
this.touchGraph = graph = new jmGraph$1(cn, options);
|
|
7878
7881
|
container.appendChild(cn);
|
|
7879
7882
|
this.touchGraph.chartGraph = this;
|
|
7880
7883
|
this.on('propertyChange', (name, args) => {
|
|
@@ -7973,11 +7976,11 @@ class jmChart extends jmGraph {
|
|
|
7973
7976
|
delete this.yAxises;
|
|
7974
7977
|
}
|
|
7975
7978
|
}
|
|
7976
|
-
/**
|
|
7977
|
-
* 获取颜色
|
|
7978
|
-
*
|
|
7979
|
-
* @method getColor
|
|
7980
|
-
* @param {int} index 颜色索引
|
|
7979
|
+
/**
|
|
7980
|
+
* 获取颜色
|
|
7981
|
+
*
|
|
7982
|
+
* @method getColor
|
|
7983
|
+
* @param {int} index 颜色索引
|
|
7981
7984
|
*/
|
|
7982
7985
|
|
|
7983
7986
|
|
|
@@ -7989,11 +7992,11 @@ class jmChart extends jmGraph {
|
|
|
7989
7992
|
|
|
7990
7993
|
return this.style.chartColors[index];
|
|
7991
7994
|
}
|
|
7992
|
-
/**
|
|
7993
|
-
* 绘制当前图表
|
|
7994
|
-
* 先绘制轴等基础信息
|
|
7995
|
-
*
|
|
7996
|
-
* @method beginDraw
|
|
7995
|
+
/**
|
|
7996
|
+
* 绘制当前图表
|
|
7997
|
+
* 先绘制轴等基础信息
|
|
7998
|
+
*
|
|
7999
|
+
* @method beginDraw
|
|
7997
8000
|
*/
|
|
7998
8001
|
|
|
7999
8002
|
|
|
@@ -8058,10 +8061,10 @@ class jmChart extends jmGraph {
|
|
|
8058
8061
|
serie.init && serie.init();
|
|
8059
8062
|
}); //console.log('beginDraw4', Date.now() - startTime);
|
|
8060
8063
|
}
|
|
8061
|
-
/**
|
|
8062
|
-
* 重新定位区域的位置
|
|
8063
|
-
*
|
|
8064
|
-
* @method resetAreaPosition
|
|
8064
|
+
/**
|
|
8065
|
+
* 重新定位区域的位置
|
|
8066
|
+
*
|
|
8067
|
+
* @method resetAreaPosition
|
|
8065
8068
|
*/
|
|
8066
8069
|
|
|
8067
8070
|
|
|
@@ -8073,15 +8076,15 @@ class jmChart extends jmGraph {
|
|
|
8073
8076
|
this.chartArea.width = w;
|
|
8074
8077
|
this.chartArea.height = h;
|
|
8075
8078
|
}
|
|
8076
|
-
/**
|
|
8077
|
-
* 创建轴
|
|
8078
|
-
*
|
|
8079
|
-
* @method createAxis
|
|
8080
|
-
* @for jmChart
|
|
8081
|
-
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
8082
|
-
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
8083
|
-
* @param {object} [style] 样式
|
|
8084
|
-
* @return {axis} 轴
|
|
8079
|
+
/**
|
|
8080
|
+
* 创建轴
|
|
8081
|
+
*
|
|
8082
|
+
* @method createAxis
|
|
8083
|
+
* @for jmChart
|
|
8084
|
+
* @param {string} [type] 轴类型(x/y/radar),默认为x
|
|
8085
|
+
* @param {string} [dataType] 当前轴的数据类型(number/date/string),默认为 number
|
|
8086
|
+
* @param {object} [style] 样式
|
|
8087
|
+
* @return {axis} 轴
|
|
8085
8088
|
*/
|
|
8086
8089
|
|
|
8087
8090
|
|
|
@@ -8093,12 +8096,12 @@ class jmChart extends jmGraph {
|
|
|
8093
8096
|
this.children.add(axis);
|
|
8094
8097
|
return axis;
|
|
8095
8098
|
}
|
|
8096
|
-
/**
|
|
8097
|
-
* 生成X轴
|
|
8098
|
-
*
|
|
8099
|
-
* @method createXAxis
|
|
8100
|
-
* @param {string} x轴的数据类型(string/number/date)
|
|
8101
|
-
* @param {bool} 是否从0开始
|
|
8099
|
+
/**
|
|
8100
|
+
* 生成X轴
|
|
8101
|
+
*
|
|
8102
|
+
* @method createXAxis
|
|
8103
|
+
* @param {string} x轴的数据类型(string/number/date)
|
|
8104
|
+
* @param {bool} 是否从0开始
|
|
8102
8105
|
*/
|
|
8103
8106
|
|
|
8104
8107
|
|
|
@@ -8125,13 +8128,13 @@ class jmChart extends jmGraph {
|
|
|
8125
8128
|
|
|
8126
8129
|
return this.xAxis;
|
|
8127
8130
|
}
|
|
8128
|
-
/**
|
|
8129
|
-
* 生成Y轴
|
|
8130
|
-
*
|
|
8131
|
-
* @method createYAxis
|
|
8132
|
-
* @param {int} Y轴索引,可以创建多个Y轴
|
|
8133
|
-
* @param {string} y轴的数据类型(string/number/date)
|
|
8134
|
-
* @param {bool} 是否从0开始
|
|
8131
|
+
/**
|
|
8132
|
+
* 生成Y轴
|
|
8133
|
+
*
|
|
8134
|
+
* @method createYAxis
|
|
8135
|
+
* @param {int} Y轴索引,可以创建多个Y轴
|
|
8136
|
+
* @param {string} y轴的数据类型(string/number/date)
|
|
8137
|
+
* @param {bool} 是否从0开始
|
|
8135
8138
|
*/
|
|
8136
8139
|
|
|
8137
8140
|
|
|
@@ -8160,14 +8163,14 @@ class jmChart extends jmGraph {
|
|
|
8160
8163
|
var yaxis = this.yAxises[options.index] || (this.yAxises[options.index] = this.createAxis(options));
|
|
8161
8164
|
return yaxis;
|
|
8162
8165
|
}
|
|
8163
|
-
/**
|
|
8164
|
-
* 创建图形
|
|
8165
|
-
*
|
|
8166
|
-
* @method createSeries
|
|
8167
|
-
* @for jmChart
|
|
8168
|
-
* @param {string} [type] 图类型,(line/bar/pie/radar)
|
|
8169
|
-
* @param {object} [options] 生成图表选项 {xField, yField, index}
|
|
8170
|
-
* @return {series} 图形
|
|
8166
|
+
/**
|
|
8167
|
+
* 创建图形
|
|
8168
|
+
*
|
|
8169
|
+
* @method createSeries
|
|
8170
|
+
* @for jmChart
|
|
8171
|
+
* @param {string} [type] 图类型,(line/bar/pie/radar)
|
|
8172
|
+
* @param {object} [options] 生成图表选项 {xField, yField, index}
|
|
8173
|
+
* @return {series} 图形
|
|
8171
8174
|
*/
|
|
8172
8175
|
|
|
8173
8176
|
|
|
@@ -8321,6 +8324,6 @@ var vchart = {
|
|
|
8321
8324
|
template: `<div ref="jmChartContainer" :style="{width: width, height: height}"></div>`
|
|
8322
8325
|
};
|
|
8323
8326
|
|
|
8324
|
-
exports
|
|
8327
|
+
exports.default = jmChart;
|
|
8325
8328
|
exports.jmChart = jmChart;
|
|
8326
8329
|
exports.vChart = vchart;
|