evui 3.3.28 → 3.3.29

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/evui.umd.js CHANGED
@@ -7949,7 +7949,7 @@ $({ target: 'Number', stat: true }, {
7949
7949
  /***/ "9224":
7950
7950
  /***/ (function(module) {
7951
7951
 
7952
- module.exports = JSON.parse("{\"a\":\"3.3.28\"}");
7952
+ module.exports = JSON.parse("{\"a\":\"3.3.29\"}");
7953
7953
 
7954
7954
  /***/ }),
7955
7955
 
@@ -34482,7 +34482,8 @@ var AXIS_OPTION = {
34482
34482
  fontFamily: 'Roboto',
34483
34483
  fontWeight: 400,
34484
34484
  fitWidth: false,
34485
- fitDir: 'right'
34485
+ fitDir: 'right',
34486
+ alignToGridLine: false
34486
34487
  },
34487
34488
  title: {
34488
34489
  use: false,
@@ -37503,7 +37504,11 @@ var scale_Scale = /*#__PURE__*/function () {
37503
37504
  numberOfSteps = Math.round(graphRange / interval);
37504
37505
 
37505
37506
  if (maxValue === 1) {
37506
- if (maxSteps > 2) {
37507
+ if (!this.decimalPoint) {
37508
+ interval = 1;
37509
+ numberOfSteps = 1;
37510
+ maxSteps = 1;
37511
+ } else if (maxSteps > 2) {
37507
37512
  interval = 0.2;
37508
37513
  numberOfSteps = 5;
37509
37514
  maxSteps = 5;
@@ -38548,6 +38553,7 @@ var scale_logarithmic_LogarithmicScale = /*#__PURE__*/function (_Scale) {
38548
38553
 
38549
38554
 
38550
38555
 
38556
+
38551
38557
  var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
38552
38558
  _inherits(StepScale, _Scale);
38553
38559
 
@@ -38574,7 +38580,7 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
38574
38580
  _createClass(StepScale, [{
38575
38581
  key: "calculateScaleRange",
38576
38582
  value: function calculateScaleRange(minMax, chartRect) {
38577
- var stepMinMax = this.rangeMode ? minMax : helpers_util.getStringMinMax(this.labels);
38583
+ var stepMinMax = this.labelStyle.alignToGridLine ? minMax : helpers_util.getStringMinMax(this.labels);
38578
38584
  var maxValue = stepMinMax.max;
38579
38585
  var minValue = stepMinMax.min;
38580
38586
  var maxWidth = chartRect.chartWidth / (this.labels.length + 2);
@@ -38598,8 +38604,11 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
38598
38604
  value: function calculateSteps(range) {
38599
38605
  var numberOfSteps = this.labels.length;
38600
38606
  var interval = 1;
38607
+ var isNumbersArray = this.labels.every(function (label) {
38608
+ return !isNaN(label);
38609
+ });
38601
38610
 
38602
- if (this.rangeMode) {
38611
+ if (this.labelStyle.alignToGridLine && isNumbersArray) {
38603
38612
  var maxSteps = range.maxSteps;
38604
38613
 
38605
38614
  if (maxSteps > 2) {
@@ -38687,6 +38696,7 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
38687
38696
  }
38688
38697
 
38689
38698
  var labelGap = (endPoint - startPoint) / labels.length;
38699
+ var alignToGridLine = this.labelStyle.alignToGridLine;
38690
38700
  var labelCenter = null;
38691
38701
  var linePosition = null;
38692
38702
  ctx.beginPath();
@@ -38716,7 +38726,7 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
38716
38726
  var _this$options3, _this$options3$select, _this$options4;
38717
38727
 
38718
38728
  labelPoint = this.position === 'top' ? offsetPoint - 10 : offsetPoint + 10;
38719
- var xPoint = this.rangeMode ? labelCenter : labelCenter + labelGap / 2;
38729
+ var xPoint = alignToGridLine ? labelCenter : labelCenter + labelGap / 2;
38720
38730
  ctx.fillText(labelText, xPoint, labelPoint);
38721
38731
 
38722
38732
  if (!isBlurredLabel && (_this$options3 = this.options) !== null && _this$options3 !== void 0 && (_this$options3$select = _this$options3.selectItem) !== null && _this$options3$select !== void 0 && _this$options3$select.showLabelTip && hitInfo !== null && hitInfo !== void 0 && hitInfo.label && !((_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.horizontal)) {
@@ -38747,7 +38757,7 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
38747
38757
  }
38748
38758
  } else {
38749
38759
  labelPoint = this.position === 'left' ? offsetPoint - 10 : offsetPoint + 10;
38750
- var yPoint = this.rangeMode ? labelCenter : labelCenter + labelGap / 2;
38760
+ var yPoint = alignToGridLine ? labelCenter : labelCenter + labelGap / 2;
38751
38761
  ctx.fillText(labelText, labelPoint, yPoint);
38752
38762
 
38753
38763
  if (index > 0 && this.showGrid) {
@@ -38759,7 +38769,7 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
38759
38769
  ctx.stroke();
38760
38770
  }
38761
38771
 
38762
- if (this.rangeMode && index === this.labels.length) {
38772
+ if (alignToGridLine && index === this.labels.length) {
38763
38773
  var labelLastText = +labels[labels.length - 1] + (+labels[1] - +labels[0]);
38764
38774
 
38765
38775
  if (isNaN(labelLastText)) {
@@ -39100,9 +39110,10 @@ var scale_time_category_TimeCategoryScale = /*#__PURE__*/function (_Scale) {
39100
39110
  return;
39101
39111
  }
39102
39112
 
39113
+ var alignToGridLine = this.labelStyle.alignToGridLine;
39103
39114
  var graphGap = (endPoint - startPoint) / (labels.length || 1);
39104
39115
 
39105
- if (this.categoryMode && !this.rangeMode) {
39116
+ if (this.categoryMode && !alignToGridLine) {
39106
39117
  startPoint += Math.ceil(graphGap / 2) - 2;
39107
39118
  }
39108
39119
 
@@ -39176,7 +39187,7 @@ var scale_time_category_TimeCategoryScale = /*#__PURE__*/function (_Scale) {
39176
39187
  ctx.stroke();
39177
39188
  }
39178
39189
 
39179
- if (this.categoryMode && this.rangeMode && count * steps === oriSteps) {
39190
+ if (this.categoryMode && alignToGridLine && count * steps === oriSteps) {
39180
39191
  var diffTime = dayjs_min_default()(labels[1]).diff(dayjs_min_default()(labels[0]));
39181
39192
  var labelLastText = this.getLabelFormat(dayjs_min_default()(labels[labels.length - 1] + diffTime));
39182
39193
  labelCenter = Math.round(startPoint + graphGap * labels.length);
@@ -39793,6 +39804,8 @@ var plugins_legend_modules = {
39793
39804
  while (legendDOM.hasChildNodes()) {
39794
39805
  legendDOM.removeChild(legendDOM.firstChild);
39795
39806
  }
39807
+
39808
+ this.seriesInfo.count = 0;
39796
39809
  },
39797
39810
 
39798
39811
  /**
@@ -41446,8 +41459,7 @@ var plugins_interaction_modules = {
41446
41459
  item.data.formatted = this.getFormattedTooltipValue({
41447
41460
  seriesName: series.name,
41448
41461
  value: hasData.o,
41449
- x: hasData.x,
41450
- y: hasData.y
41462
+ itemData: hasData
41451
41463
  });
41452
41464
  hitInfo.items[sId] = item;
41453
41465
  }