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