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