chartkick 5.1.5 → 5.2.1

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,5 +1,5 @@
1
1
  /*!
2
- * Chart.js v4.4.9
2
+ * Chart.js v4.5.1
3
3
  * https://www.chartjs.org
4
4
  * (c) 2025 Chart.js Contributors
5
5
  * Released under the MIT License
@@ -3169,19 +3169,19 @@
3169
3169
  try {
3170
3170
  for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
3171
3171
  var scope = _step9.value;
3172
- var _iterator10 = _createForOfIteratorHelper$1(Object.keys(scope).filter(function (k) {
3172
+ var _iterator0 = _createForOfIteratorHelper$1(Object.keys(scope).filter(function (k) {
3173
3173
  return !k.startsWith('_');
3174
3174
  })),
3175
- _step10;
3175
+ _step0;
3176
3176
  try {
3177
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
3178
- var key = _step10.value;
3177
+ for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
3178
+ var key = _step0.value;
3179
3179
  set.add(key);
3180
3180
  }
3181
3181
  } catch (err) {
3182
- _iterator10.e(err);
3182
+ _iterator0.e(err);
3183
3183
  } finally {
3184
- _iterator10.f();
3184
+ _iterator0.f();
3185
3185
  }
3186
3186
  }
3187
3187
  } catch (err) {
@@ -3565,10 +3565,10 @@
3565
3565
  */
3566
3566
  function retinaScale(chart, forceRatio, forceStyle) {
3567
3567
  var pixelRatio = forceRatio || 1;
3568
- var deviceHeight = Math.floor(chart.height * pixelRatio);
3569
- var deviceWidth = Math.floor(chart.width * pixelRatio);
3570
- chart.height = Math.floor(chart.height);
3571
- chart.width = Math.floor(chart.width);
3568
+ var deviceHeight = round1(chart.height * pixelRatio);
3569
+ var deviceWidth = round1(chart.width * pixelRatio);
3570
+ chart.height = round1(chart.height);
3571
+ chart.width = round1(chart.width);
3572
3572
  var canvas = chart.canvas;
3573
3573
  // If no style has been set on the canvas, the render size is used as display size,
3574
3574
  // making the chart visually bigger, so let's enforce it to the "correct" values.
@@ -3985,11 +3985,11 @@
3985
3985
  start = e % count;
3986
3986
  }
3987
3987
  }
3988
- var _iterator11 = _createForOfIteratorHelper$1(segments),
3989
- _step11;
3988
+ var _iterator1 = _createForOfIteratorHelper$1(segments),
3989
+ _step1;
3990
3990
  try {
3991
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
3992
- var segment = _step11.value;
3991
+ for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
3992
+ var segment = _step1.value;
3993
3993
  start = spanGaps ? start : segment.start;
3994
3994
  var prev = points[start % count];
3995
3995
  var style = void 0;
@@ -4014,9 +4014,9 @@
4014
4014
  }
4015
4015
  }
4016
4016
  } catch (err) {
4017
- _iterator11.e(err);
4017
+ _iterator1.e(err);
4018
4018
  } finally {
4019
- _iterator11.f();
4019
+ _iterator1.f();
4020
4020
  }
4021
4021
  return result;
4022
4022
  }
@@ -5786,6 +5786,39 @@
5786
5786
  value: function _getStackCount(index) {
5787
5787
  return this._getStacks(undefined, index).length;
5788
5788
  }
5789
+ }, {
5790
+ key: "_getAxisCount",
5791
+ value: function _getAxisCount() {
5792
+ return this._getAxis().length;
5793
+ }
5794
+ }, {
5795
+ key: "getFirstScaleIdForIndexAxis",
5796
+ value: function getFirstScaleIdForIndexAxis() {
5797
+ var scales = this.chart.scales;
5798
+ var indexScaleId = this.chart.options.indexAxis;
5799
+ return Object.keys(scales).filter(function (key) {
5800
+ return scales[key].axis === indexScaleId;
5801
+ }).shift();
5802
+ }
5803
+ }, {
5804
+ key: "_getAxis",
5805
+ value: function _getAxis() {
5806
+ var axis = {};
5807
+ var firstScaleAxisId = this.getFirstScaleIdForIndexAxis();
5808
+ var _iterator5 = _createForOfIteratorHelper$1(this.chart.data.datasets),
5809
+ _step5;
5810
+ try {
5811
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
5812
+ var dataset = _step5.value;
5813
+ axis[valueOrDefault(this.chart.options.indexAxis === 'x' ? dataset.xAxisID : dataset.yAxisID, firstScaleAxisId)] = true;
5814
+ }
5815
+ } catch (err) {
5816
+ _iterator5.e(err);
5817
+ } finally {
5818
+ _iterator5.f();
5819
+ }
5820
+ return Object.keys(axis);
5821
+ }
5789
5822
  }, {
5790
5823
  key: "_getStackIndex",
5791
5824
  value: function _getStackIndex(datasetIndex, name, dataIndex) {
@@ -5890,10 +5923,13 @@
5890
5923
  var skipNull = options.skipNull;
5891
5924
  var maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);
5892
5925
  var center, size;
5926
+ var axisCount = this._getAxisCount();
5893
5927
  if (ruler.grouped) {
5894
5928
  var stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;
5895
- var range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount);
5896
- var stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);
5929
+ var range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount * axisCount) : computeFitCategoryTraits(index, ruler, options, stackCount * axisCount);
5930
+ var axisID = this.chart.options.indexAxis === 'x' ? this.getDataset().xAxisID : this.getDataset().yAxisID;
5931
+ var axisNumber = this._getAxis().indexOf(valueOrDefault(axisID, this.getFirstScaleIdForIndexAxis()));
5932
+ var stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined) + axisNumber;
5897
5933
  center = range.start + range.chunk * stackIndex + range.chunk / 2;
5898
5934
  size = Math.min(maxBarThickness, range.chunk * range.ratio);
5899
5935
  } else {
@@ -6411,21 +6447,29 @@
6411
6447
  labels: {
6412
6448
  generateLabels: function generateLabels(chart) {
6413
6449
  var data = chart.data;
6450
+ var _chart$legend$options2 = chart.legend.options.labels,
6451
+ pointStyle = _chart$legend$options2.pointStyle,
6452
+ textAlign = _chart$legend$options2.textAlign,
6453
+ color = _chart$legend$options2.color,
6454
+ useBorderRadius = _chart$legend$options2.useBorderRadius,
6455
+ borderRadius = _chart$legend$options2.borderRadius;
6414
6456
  if (data.labels.length && data.datasets.length) {
6415
- var _chart$legend$options2 = chart.legend.options.labels,
6416
- pointStyle = _chart$legend$options2.pointStyle,
6417
- color = _chart$legend$options2.color;
6418
6457
  return data.labels.map(function (label, i) {
6419
6458
  var meta = chart.getDatasetMeta(0);
6420
6459
  var style = meta.controller.getStyle(i);
6421
6460
  return {
6422
6461
  text: label,
6423
6462
  fillStyle: style.backgroundColor,
6424
- strokeStyle: style.borderColor,
6425
6463
  fontColor: color,
6464
+ hidden: !chart.getDataVisibility(i),
6465
+ lineDash: style.borderDash,
6466
+ lineDashOffset: style.borderDashOffset,
6467
+ lineJoin: style.borderJoinStyle,
6426
6468
  lineWidth: style.borderWidth,
6469
+ strokeStyle: style.borderColor,
6470
+ textAlign: textAlign,
6427
6471
  pointStyle: pointStyle,
6428
- hidden: !chart.getDataVisibility(i),
6472
+ borderRadius: useBorderRadius && (borderRadius || style.borderRadius),
6429
6473
  index: i
6430
6474
  };
6431
6475
  });
@@ -7398,11 +7442,11 @@
7398
7442
  }
7399
7443
  function buildStacks(layouts) {
7400
7444
  var stacks = {};
7401
- var _iterator5 = _createForOfIteratorHelper$1(layouts),
7402
- _step5;
7445
+ var _iterator6 = _createForOfIteratorHelper$1(layouts),
7446
+ _step6;
7403
7447
  try {
7404
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
7405
- var wrap = _step5.value;
7448
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7449
+ var wrap = _step6.value;
7406
7450
  var stack = wrap.stack,
7407
7451
  pos = wrap.pos,
7408
7452
  stackWeight = wrap.stackWeight;
@@ -7419,9 +7463,9 @@
7419
7463
  _stack.weight += stackWeight;
7420
7464
  }
7421
7465
  } catch (err) {
7422
- _iterator5.e(err);
7466
+ _iterator6.e(err);
7423
7467
  } finally {
7424
- _iterator5.f();
7468
+ _iterator6.f();
7425
7469
  }
7426
7470
  return stacks;
7427
7471
  }
@@ -7565,11 +7609,11 @@
7565
7609
  var userPadding = params.padding;
7566
7610
  var x = chartArea.x,
7567
7611
  y = chartArea.y;
7568
- var _iterator6 = _createForOfIteratorHelper$1(boxes),
7569
- _step6;
7612
+ var _iterator7 = _createForOfIteratorHelper$1(boxes),
7613
+ _step7;
7570
7614
  try {
7571
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7572
- var layout = _step6.value;
7615
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7616
+ var layout = _step7.value;
7573
7617
  var box = layout.box;
7574
7618
  var stack = stacks[layout.stack] || {
7575
7619
  count: 1,
@@ -7608,9 +7652,9 @@
7608
7652
  }
7609
7653
  }
7610
7654
  } catch (err) {
7611
- _iterator6.e(err);
7655
+ _iterator7.e(err);
7612
7656
  } finally {
7613
- _iterator6.f();
7657
+ _iterator7.f();
7614
7658
  }
7615
7659
  chartArea.x = x;
7616
7660
  chartArea.y = y;
@@ -7849,37 +7893,37 @@
7849
7893
  };
7850
7894
  }
7851
7895
  function nodeListContains(nodeList, canvas) {
7852
- var _iterator7 = _createForOfIteratorHelper$1(nodeList),
7853
- _step7;
7896
+ var _iterator8 = _createForOfIteratorHelper$1(nodeList),
7897
+ _step8;
7854
7898
  try {
7855
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7856
- var node = _step7.value;
7899
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
7900
+ var node = _step8.value;
7857
7901
  if (node === canvas || node.contains(canvas)) {
7858
7902
  return true;
7859
7903
  }
7860
7904
  }
7861
7905
  } catch (err) {
7862
- _iterator7.e(err);
7906
+ _iterator8.e(err);
7863
7907
  } finally {
7864
- _iterator7.f();
7908
+ _iterator8.f();
7865
7909
  }
7866
7910
  }
7867
7911
  function createAttachObserver(chart, type, listener) {
7868
7912
  var canvas = chart.canvas;
7869
7913
  var observer = new MutationObserver(function (entries) {
7870
7914
  var trigger = false;
7871
- var _iterator8 = _createForOfIteratorHelper$1(entries),
7872
- _step8;
7915
+ var _iterator9 = _createForOfIteratorHelper$1(entries),
7916
+ _step9;
7873
7917
  try {
7874
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
7875
- var entry = _step8.value;
7918
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
7919
+ var entry = _step9.value;
7876
7920
  trigger = trigger || nodeListContains(entry.addedNodes, canvas);
7877
7921
  trigger = trigger && !nodeListContains(entry.removedNodes, canvas);
7878
7922
  }
7879
7923
  } catch (err) {
7880
- _iterator8.e(err);
7924
+ _iterator9.e(err);
7881
7925
  } finally {
7882
- _iterator8.f();
7926
+ _iterator9.f();
7883
7927
  }
7884
7928
  if (trigger) {
7885
7929
  listener();
@@ -7895,18 +7939,18 @@
7895
7939
  var canvas = chart.canvas;
7896
7940
  var observer = new MutationObserver(function (entries) {
7897
7941
  var trigger = false;
7898
- var _iterator9 = _createForOfIteratorHelper$1(entries),
7899
- _step9;
7942
+ var _iterator0 = _createForOfIteratorHelper$1(entries),
7943
+ _step0;
7900
7944
  try {
7901
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
7902
- var entry = _step9.value;
7945
+ for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
7946
+ var entry = _step0.value;
7903
7947
  trigger = trigger || nodeListContains(entry.removedNodes, canvas);
7904
7948
  trigger = trigger && !nodeListContains(entry.addedNodes, canvas);
7905
7949
  }
7906
7950
  } catch (err) {
7907
- _iterator9.e(err);
7951
+ _iterator0.e(err);
7908
7952
  } finally {
7909
- _iterator9.f();
7953
+ _iterator0.f();
7910
7954
  }
7911
7955
  if (trigger) {
7912
7956
  listener();
@@ -9513,9 +9557,9 @@
9513
9557
  value: function drawBorder() {
9514
9558
  var chart = this.chart,
9515
9559
  ctx = this.ctx,
9516
- _this$options10 = this.options,
9517
- border = _this$options10.border,
9518
- grid = _this$options10.grid;
9560
+ _this$options0 = this.options,
9561
+ border = _this$options0.border,
9562
+ grid = _this$options0.grid;
9519
9563
  var borderOpts = border.setContext(this.getContext());
9520
9564
  var axisWidth = border.display ? borderOpts.width : 0;
9521
9565
  if (!axisWidth) {
@@ -9555,11 +9599,11 @@
9555
9599
  clipArea(ctx, area);
9556
9600
  }
9557
9601
  var items = this.getLabelItems(chartArea);
9558
- var _iterator10 = _createForOfIteratorHelper$1(items),
9559
- _step10;
9602
+ var _iterator1 = _createForOfIteratorHelper$1(items),
9603
+ _step1;
9560
9604
  try {
9561
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
9562
- var item = _step10.value;
9605
+ for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
9606
+ var item = _step1.value;
9563
9607
  var renderTextOptions = item.options;
9564
9608
  var tickFont = item.font;
9565
9609
  var label = item.label;
@@ -9567,9 +9611,9 @@
9567
9611
  renderText(ctx, label, 0, y, tickFont, renderTextOptions);
9568
9612
  }
9569
9613
  } catch (err) {
9570
- _iterator10.e(err);
9614
+ _iterator1.e(err);
9571
9615
  } finally {
9572
- _iterator10.f();
9616
+ _iterator1.f();
9573
9617
  }
9574
9618
  if (area) {
9575
9619
  unclipArea(ctx);
@@ -9579,10 +9623,10 @@
9579
9623
  key: "drawTitle",
9580
9624
  value: function drawTitle() {
9581
9625
  var ctx = this.ctx,
9582
- _this$options11 = this.options,
9583
- position = _this$options11.position,
9584
- title = _this$options11.title,
9585
- reverse = _this$options11.reverse;
9626
+ _this$options1 = this.options,
9627
+ position = _this$options1.position,
9628
+ title = _this$options1.title,
9629
+ reverse = _this$options1.reverse;
9586
9630
  if (!title.display) {
9587
9631
  return;
9588
9632
  }
@@ -9627,7 +9671,7 @@
9627
9671
  }, {
9628
9672
  key: "_layers",
9629
9673
  value: function _layers() {
9630
- var _this10 = this;
9674
+ var _this0 = this;
9631
9675
  var opts = this.options;
9632
9676
  var tz = opts.ticks && opts.ticks.z || 0;
9633
9677
  var gz = valueOrDefault(opts.grid && opts.grid.z, -1);
@@ -9636,26 +9680,26 @@
9636
9680
  return [{
9637
9681
  z: tz,
9638
9682
  draw: function draw(chartArea) {
9639
- _this10.draw(chartArea);
9683
+ _this0.draw(chartArea);
9640
9684
  }
9641
9685
  }];
9642
9686
  }
9643
9687
  return [{
9644
9688
  z: gz,
9645
9689
  draw: function draw(chartArea) {
9646
- _this10.drawBackground();
9647
- _this10.drawGrid(chartArea);
9648
- _this10.drawTitle();
9690
+ _this0.drawBackground();
9691
+ _this0.drawGrid(chartArea);
9692
+ _this0.drawTitle();
9649
9693
  }
9650
9694
  }, {
9651
9695
  z: bz,
9652
9696
  draw: function draw() {
9653
- _this10.drawBorder();
9697
+ _this0.drawBorder();
9654
9698
  }
9655
9699
  }, {
9656
9700
  z: tz,
9657
9701
  draw: function draw(chartArea) {
9658
- _this10.drawLabels(chartArea);
9702
+ _this0.drawLabels(chartArea);
9659
9703
  }
9660
9704
  }];
9661
9705
  }
@@ -9876,23 +9920,23 @@
9876
9920
  }, {
9877
9921
  key: "removeScales",
9878
9922
  value: function removeScales() {
9879
- for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
9880
- args[_key10] = arguments[_key10];
9923
+ for (var _len0 = arguments.length, args = new Array(_len0), _key0 = 0; _key0 < _len0; _key0++) {
9924
+ args[_key0] = arguments[_key0];
9881
9925
  }
9882
9926
  this._each('unregister', args, this.scales);
9883
9927
  }
9884
9928
  }, {
9885
9929
  key: "_each",
9886
9930
  value: function _each(method, args, typedRegistry) {
9887
- var _this11 = this;
9931
+ var _this1 = this;
9888
9932
  _toConsumableArray(args).forEach(function (arg) {
9889
- var reg = typedRegistry || _this11._getRegistryForType(arg);
9890
- if (typedRegistry || reg.isForType(arg) || reg === _this11.plugins && arg.id) {
9891
- _this11._exec(method, reg, arg);
9933
+ var reg = typedRegistry || _this1._getRegistryForType(arg);
9934
+ if (typedRegistry || reg.isForType(arg) || reg === _this1.plugins && arg.id) {
9935
+ _this1._exec(method, reg, arg);
9892
9936
  } else {
9893
9937
  each(arg, function (item) {
9894
- var itemReg = typedRegistry || _this11._getRegistryForType(item);
9895
- _this11._exec(method, itemReg, item);
9938
+ var itemReg = typedRegistry || _this1._getRegistryForType(item);
9939
+ _this1._exec(method, itemReg, item);
9896
9940
  });
9897
9941
  }
9898
9942
  });
@@ -9931,7 +9975,7 @@
9931
9975
  var PluginService = /*#__PURE__*/function () {
9932
9976
  function PluginService() {
9933
9977
  _classCallCheck$1(this, PluginService);
9934
- this._init = [];
9978
+ this._init = undefined;
9935
9979
  }
9936
9980
  return _createClass$1(PluginService, [{
9937
9981
  key: "notify",
@@ -9940,11 +9984,15 @@
9940
9984
  this._init = this._createDescriptors(chart, true);
9941
9985
  this._notify(this._init, chart, 'install');
9942
9986
  }
9987
+ if (this._init === undefined) {
9988
+ return;
9989
+ }
9943
9990
  var descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);
9944
9991
  var result = this._notify(descriptors, chart, hook, args);
9945
9992
  if (hook === 'afterDestroy') {
9946
9993
  this._notify(descriptors, chart, 'stop');
9947
9994
  this._notify(this._init, chart, 'uninstall');
9995
+ this._init = undefined;
9948
9996
  }
9949
9997
  return result;
9950
9998
  }
@@ -9952,11 +10000,11 @@
9952
10000
  key: "_notify",
9953
10001
  value: function _notify(descriptors, chart, hook, args) {
9954
10002
  args = args || {};
9955
- var _iterator11 = _createForOfIteratorHelper$1(descriptors),
9956
- _step11;
10003
+ var _iterator10 = _createForOfIteratorHelper$1(descriptors),
10004
+ _step10;
9957
10005
  try {
9958
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
9959
- var descriptor = _step11.value;
10006
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
10007
+ var descriptor = _step10.value;
9960
10008
  var plugin = descriptor.plugin;
9961
10009
  var method = plugin[hook];
9962
10010
  var params = [chart, args, descriptor.options];
@@ -9965,9 +10013,9 @@
9965
10013
  }
9966
10014
  }
9967
10015
  } catch (err) {
9968
- _iterator11.e(err);
10016
+ _iterator10.e(err);
9969
10017
  } finally {
9970
- _iterator11.f();
10018
+ _iterator10.f();
9971
10019
  }
9972
10020
  return true;
9973
10021
  }
@@ -10048,11 +10096,11 @@
10048
10096
  localIds = _ref2.localIds;
10049
10097
  var result = [];
10050
10098
  var context = chart.getContext();
10051
- var _iterator12 = _createForOfIteratorHelper$1(plugins),
10052
- _step12;
10099
+ var _iterator11 = _createForOfIteratorHelper$1(plugins),
10100
+ _step11;
10053
10101
  try {
10054
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
10055
- var plugin = _step12.value;
10102
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
10103
+ var plugin = _step11.value;
10056
10104
  var id = plugin.id;
10057
10105
  var opts = getOpts(options[id], all);
10058
10106
  if (opts === null) {
@@ -10067,9 +10115,9 @@
10067
10115
  });
10068
10116
  }
10069
10117
  } catch (err) {
10070
- _iterator12.e(err);
10118
+ _iterator11.e(err);
10071
10119
  } finally {
10072
- _iterator12.f();
10120
+ _iterator11.f();
10073
10121
  }
10074
10122
  return result;
10075
10123
  }
@@ -10121,8 +10169,8 @@
10121
10169
  if (idMatchesAxis(id)) {
10122
10170
  return id;
10123
10171
  }
10124
- for (var _len11 = arguments.length, scaleOptions = new Array(_len11 > 1 ? _len11 - 1 : 0), _key11 = 1; _key11 < _len11; _key11++) {
10125
- scaleOptions[_key11 - 1] = arguments[_key11];
10172
+ for (var _len1 = arguments.length, scaleOptions = new Array(_len1 > 1 ? _len1 - 1 : 0), _key1 = 1; _key1 < _len1; _key1++) {
10173
+ scaleOptions[_key1 - 1] = arguments[_key1];
10126
10174
  }
10127
10175
  for (var _i3 = 0, _scaleOptions = scaleOptions; _i3 < _scaleOptions.length; _i3++) {
10128
10176
  var opts = _scaleOptions[_i3];
@@ -10388,17 +10436,17 @@
10388
10436
  var subResolver = this.createResolver(scopes, context, subPrefixes);
10389
10437
  options = _attachContext(resolver, context, subResolver);
10390
10438
  }
10391
- var _iterator13 = _createForOfIteratorHelper$1(names),
10392
- _step13;
10439
+ var _iterator12 = _createForOfIteratorHelper$1(names),
10440
+ _step12;
10393
10441
  try {
10394
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
10395
- var prop = _step13.value;
10442
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
10443
+ var prop = _step12.value;
10396
10444
  result[prop] = options[prop];
10397
10445
  }
10398
10446
  } catch (err) {
10399
- _iterator13.e(err);
10447
+ _iterator12.e(err);
10400
10448
  } finally {
10401
- _iterator13.f();
10449
+ _iterator12.f();
10402
10450
  }
10403
10451
  return result;
10404
10452
  }
@@ -10442,11 +10490,11 @@
10442
10490
  var _descriptors2 = _descriptors(proxy),
10443
10491
  isScriptable = _descriptors2.isScriptable,
10444
10492
  isIndexable = _descriptors2.isIndexable;
10445
- var _iterator14 = _createForOfIteratorHelper$1(names),
10446
- _step14;
10493
+ var _iterator13 = _createForOfIteratorHelper$1(names),
10494
+ _step13;
10447
10495
  try {
10448
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
10449
- var prop = _step14.value;
10496
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
10497
+ var prop = _step13.value;
10450
10498
  var scriptable = isScriptable(prop);
10451
10499
  var indexable = isIndexable(prop);
10452
10500
  var value = (indexable || scriptable) && proxy[prop];
@@ -10455,13 +10503,13 @@
10455
10503
  }
10456
10504
  }
10457
10505
  } catch (err) {
10458
- _iterator14.e(err);
10506
+ _iterator13.e(err);
10459
10507
  } finally {
10460
- _iterator14.f();
10508
+ _iterator13.f();
10461
10509
  }
10462
10510
  return false;
10463
10511
  }
10464
- var version = "4.4.9";
10512
+ var version = "4.5.1";
10465
10513
  var KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];
10466
10514
  function positionIsHorizontal(position, axis) {
10467
10515
  return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';
@@ -10525,7 +10573,7 @@
10525
10573
  }
10526
10574
  var Chart = /*#__PURE__*/function () {
10527
10575
  function Chart(item, userConfig) {
10528
- var _this12 = this;
10576
+ var _this10 = this;
10529
10577
  _classCallCheck$1(this, Chart);
10530
10578
  var config = this.config = new Config(userConfig);
10531
10579
  var initialCanvas = getCanvas(item);
@@ -10566,7 +10614,7 @@
10566
10614
  this._animationsDisabled = undefined;
10567
10615
  this.$context = undefined;
10568
10616
  this._doResize = debounce(function (mode) {
10569
- return _this12.update(mode);
10617
+ return _this10.update(mode);
10570
10618
  }, options.resizeDelay || 0);
10571
10619
  this._dataChanges = [];
10572
10620
  instances[this.id] = this;
@@ -10584,9 +10632,9 @@
10584
10632
  return _createClass$1(Chart, [{
10585
10633
  key: "aspectRatio",
10586
10634
  get: function get() {
10587
- var _this$options12 = this.options,
10588
- aspectRatio = _this$options12.aspectRatio,
10589
- maintainAspectRatio = _this$options12.maintainAspectRatio,
10635
+ var _this$options10 = this.options,
10636
+ aspectRatio = _this$options10.aspectRatio,
10637
+ maintainAspectRatio = _this$options10.maintainAspectRatio,
10590
10638
  width = this.width,
10591
10639
  height = this.height,
10592
10640
  _aspectRatio = this._aspectRatio;
@@ -10693,7 +10741,7 @@
10693
10741
  }, {
10694
10742
  key: "buildOrUpdateScales",
10695
10743
  value: function buildOrUpdateScales() {
10696
- var _this13 = this;
10744
+ var _this11 = this;
10697
10745
  var options = this.options;
10698
10746
  var scaleOpts = options.scales;
10699
10747
  var scales = this.scales;
@@ -10732,8 +10780,8 @@
10732
10780
  scale = new scaleClass({
10733
10781
  id: id,
10734
10782
  type: scaleType,
10735
- ctx: _this13.ctx,
10736
- chart: _this13
10783
+ ctx: _this11.ctx,
10784
+ chart: _this11
10737
10785
  });
10738
10786
  scales[scale.id] = scale;
10739
10787
  }
@@ -10745,8 +10793,8 @@
10745
10793
  }
10746
10794
  });
10747
10795
  each(scales, function (scale) {
10748
- layouts.configure(_this13, scale, scale.options);
10749
- layouts.addBox(_this13, scale);
10796
+ layouts.configure(_this11, scale, scale.options);
10797
+ layouts.addBox(_this11, scale);
10750
10798
  });
10751
10799
  }
10752
10800
  }, {
@@ -10769,7 +10817,7 @@
10769
10817
  }, {
10770
10818
  key: "_removeUnreferencedMetasets",
10771
10819
  value: function _removeUnreferencedMetasets() {
10772
- var _this14 = this;
10820
+ var _this12 = this;
10773
10821
  var metasets = this._metasets,
10774
10822
  datasets = this.data.datasets;
10775
10823
  if (metasets.length > datasets.length) {
@@ -10779,7 +10827,7 @@
10779
10827
  if (datasets.filter(function (x) {
10780
10828
  return x === meta._dataset;
10781
10829
  }).length === 0) {
10782
- _this14._destroyDatasetMeta(index);
10830
+ _this12._destroyDatasetMeta(index);
10783
10831
  }
10784
10832
  });
10785
10833
  }
@@ -10826,9 +10874,9 @@
10826
10874
  }, {
10827
10875
  key: "_resetElements",
10828
10876
  value: function _resetElements() {
10829
- var _this15 = this;
10877
+ var _this13 = this;
10830
10878
  each(this.data.datasets, function (dataset, datasetIndex) {
10831
- _this15.getDatasetMeta(datasetIndex).controller.reset();
10879
+ _this13.getDatasetMeta(datasetIndex).controller.reset();
10832
10880
  }, this);
10833
10881
  }
10834
10882
  }, {
@@ -10888,9 +10936,9 @@
10888
10936
  }, {
10889
10937
  key: "_updateScales",
10890
10938
  value: function _updateScales() {
10891
- var _this16 = this;
10939
+ var _this14 = this;
10892
10940
  each(this.scales, function (scale) {
10893
- layouts.removeBox(_this16, scale);
10941
+ layouts.removeBox(_this14, scale);
10894
10942
  });
10895
10943
  this.ensureScalesHaveIDs();
10896
10944
  this.buildOrUpdateScales();
@@ -10911,21 +10959,21 @@
10911
10959
  value: function _updateHiddenIndices() {
10912
10960
  var _hiddenIndices = this._hiddenIndices;
10913
10961
  var changes = this._getUniformDataChanges() || [];
10914
- var _iterator15 = _createForOfIteratorHelper$1(changes),
10915
- _step15;
10962
+ var _iterator14 = _createForOfIteratorHelper$1(changes),
10963
+ _step14;
10916
10964
  try {
10917
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
10918
- var _step15$value = _step15.value,
10919
- method = _step15$value.method,
10920
- start = _step15$value.start,
10921
- count = _step15$value.count;
10965
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
10966
+ var _step14$value = _step14.value,
10967
+ method = _step14$value.method,
10968
+ start = _step14$value.start,
10969
+ count = _step14$value.count;
10922
10970
  var move = method === '_removeElements' ? -count : count;
10923
10971
  moveNumericKeys(_hiddenIndices, start, move);
10924
10972
  }
10925
10973
  } catch (err) {
10926
- _iterator15.e(err);
10974
+ _iterator14.e(err);
10927
10975
  } finally {
10928
- _iterator15.f();
10976
+ _iterator14.f();
10929
10977
  }
10930
10978
  }
10931
10979
  }, {
@@ -10963,7 +11011,7 @@
10963
11011
  }, {
10964
11012
  key: "_updateLayout",
10965
11013
  value: function _updateLayout(minPadding) {
10966
- var _this17 = this;
11014
+ var _this15 = this;
10967
11015
  if (this.notifyPlugins('beforeLayout', {
10968
11016
  cancelable: true
10969
11017
  }) === false) {
@@ -10974,14 +11022,14 @@
10974
11022
  var noArea = area.width <= 0 || area.height <= 0;
10975
11023
  this._layers = [];
10976
11024
  each(this.boxes, function (box) {
10977
- var _this17$_layers;
11025
+ var _this15$_layers;
10978
11026
  if (noArea && box.position === 'chartArea') {
10979
11027
  return;
10980
11028
  }
10981
11029
  if (box.configure) {
10982
11030
  box.configure();
10983
11031
  }
10984
- (_this17$_layers = _this17._layers).push.apply(_this17$_layers, _toConsumableArray(box._layers()));
11032
+ (_this15$_layers = _this15._layers).push.apply(_this15$_layers, _toConsumableArray(box._layers()));
10985
11033
  }, this);
10986
11034
  this._layers.forEach(function (item, index) {
10987
11035
  item._idx = index;
@@ -11296,17 +11344,17 @@
11296
11344
  }, {
11297
11345
  key: "bindUserEvents",
11298
11346
  value: function bindUserEvents() {
11299
- var _this18 = this;
11347
+ var _this16 = this;
11300
11348
  var listeners = this._listeners;
11301
11349
  var platform = this.platform;
11302
11350
  var _add = function _add(type, listener) {
11303
- platform.addEventListener(_this18, type, listener);
11351
+ platform.addEventListener(_this16, type, listener);
11304
11352
  listeners[type] = listener;
11305
11353
  };
11306
11354
  var listener = function listener(e, x, y) {
11307
11355
  e.offsetX = x;
11308
11356
  e.offsetY = y;
11309
- _this18._eventHandler(e);
11357
+ _this16._eventHandler(e);
11310
11358
  };
11311
11359
  each(this.options.events, function (type) {
11312
11360
  return _add(type, listener);
@@ -11315,40 +11363,40 @@
11315
11363
  }, {
11316
11364
  key: "bindResponsiveEvents",
11317
11365
  value: function bindResponsiveEvents() {
11318
- var _this19 = this;
11366
+ var _this17 = this;
11319
11367
  if (!this._responsiveListeners) {
11320
11368
  this._responsiveListeners = {};
11321
11369
  }
11322
11370
  var listeners = this._responsiveListeners;
11323
11371
  var platform = this.platform;
11324
11372
  var _add = function _add(type, listener) {
11325
- platform.addEventListener(_this19, type, listener);
11373
+ platform.addEventListener(_this17, type, listener);
11326
11374
  listeners[type] = listener;
11327
11375
  };
11328
11376
  var _remove = function _remove(type, listener) {
11329
11377
  if (listeners[type]) {
11330
- platform.removeEventListener(_this19, type, listener);
11378
+ platform.removeEventListener(_this17, type, listener);
11331
11379
  delete listeners[type];
11332
11380
  }
11333
11381
  };
11334
11382
  var listener = function listener(width, height) {
11335
- if (_this19.canvas) {
11336
- _this19.resize(width, height);
11383
+ if (_this17.canvas) {
11384
+ _this17.resize(width, height);
11337
11385
  }
11338
11386
  };
11339
11387
  var detached;
11340
11388
  var _attached = function attached() {
11341
11389
  _remove('attach', _attached);
11342
- _this19.attached = true;
11343
- _this19.resize();
11390
+ _this17.attached = true;
11391
+ _this17.resize();
11344
11392
  _add('resize', listener);
11345
11393
  _add('detach', detached);
11346
11394
  };
11347
11395
  detached = function detached() {
11348
- _this19.attached = false;
11396
+ _this17.attached = false;
11349
11397
  _remove('resize', listener);
11350
- _this19._stop();
11351
- _this19._resize(0, 0);
11398
+ _this17._stop();
11399
+ _this17._resize(0, 0);
11352
11400
  _add('attach', _attached);
11353
11401
  };
11354
11402
  if (platform.isAttached(this.canvas)) {
@@ -11360,13 +11408,13 @@
11360
11408
  }, {
11361
11409
  key: "unbindEvents",
11362
11410
  value: function unbindEvents() {
11363
- var _this20 = this;
11411
+ var _this18 = this;
11364
11412
  each(this._listeners, function (listener, type) {
11365
- _this20.platform.removeEventListener(_this20, type, listener);
11413
+ _this18.platform.removeEventListener(_this18, type, listener);
11366
11414
  });
11367
11415
  this._listeners = {};
11368
11416
  each(this._responsiveListeners, function (listener, type) {
11369
- _this20.platform.removeEventListener(_this20, type, listener);
11417
+ _this18.platform.removeEventListener(_this18, type, listener);
11370
11418
  });
11371
11419
  this._responsiveListeners = undefined;
11372
11420
  }
@@ -11395,12 +11443,12 @@
11395
11443
  }, {
11396
11444
  key: "setActiveElements",
11397
11445
  value: function setActiveElements(activeElements) {
11398
- var _this21 = this;
11446
+ var _this19 = this;
11399
11447
  var lastActive = this._active || [];
11400
11448
  var active = activeElements.map(function (_ref4) {
11401
11449
  var datasetIndex = _ref4.datasetIndex,
11402
11450
  index = _ref4.index;
11403
- var meta = _this21.getDatasetMeta(datasetIndex);
11451
+ var meta = _this19.getDatasetMeta(datasetIndex);
11404
11452
  if (!meta) {
11405
11453
  throw new Error('No dataset found at index ' + datasetIndex);
11406
11454
  }
@@ -11452,7 +11500,7 @@
11452
11500
  }, {
11453
11501
  key: "_eventHandler",
11454
11502
  value: function _eventHandler(e, replay) {
11455
- var _this22 = this;
11503
+ var _this20 = this;
11456
11504
  var args = {
11457
11505
  event: e,
11458
11506
  replay: replay,
@@ -11460,7 +11508,7 @@
11460
11508
  inChartArea: this.isPointInArea(e)
11461
11509
  };
11462
11510
  var eventFilter = function eventFilter(plugin) {
11463
- return (plugin.options.events || _this22.options.events).includes(e["native"].type);
11511
+ return (plugin.options.events || _this20.options.events).includes(e["native"].type);
11464
11512
  };
11465
11513
  if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {
11466
11514
  return;
@@ -11535,6 +11583,40 @@
11535
11583
  return chart._plugins.invalidate();
11536
11584
  });
11537
11585
  }
11586
+ function clipSelf(ctx, element, endAngle) {
11587
+ var startAngle = element.startAngle,
11588
+ x = element.x,
11589
+ y = element.y,
11590
+ outerRadius = element.outerRadius,
11591
+ innerRadius = element.innerRadius,
11592
+ options = element.options;
11593
+ var borderWidth = options.borderWidth,
11594
+ borderJoinStyle = options.borderJoinStyle;
11595
+ var outerAngleClip = Math.min(borderWidth / outerRadius, _normalizeAngle(startAngle - endAngle));
11596
+ ctx.beginPath();
11597
+ ctx.arc(x, y, outerRadius - borderWidth / 2, startAngle + outerAngleClip / 2, endAngle - outerAngleClip / 2);
11598
+ if (innerRadius > 0) {
11599
+ var innerAngleClip = Math.min(borderWidth / innerRadius, _normalizeAngle(startAngle - endAngle));
11600
+ ctx.arc(x, y, innerRadius + borderWidth / 2, endAngle - innerAngleClip / 2, startAngle + innerAngleClip / 2, true);
11601
+ } else {
11602
+ var clipWidth = Math.min(borderWidth / 2, outerRadius * _normalizeAngle(startAngle - endAngle));
11603
+ if (borderJoinStyle === 'round') {
11604
+ ctx.arc(x, y, clipWidth, endAngle - PI / 2, startAngle + PI / 2, true);
11605
+ } else if (borderJoinStyle === 'bevel') {
11606
+ var r = 2 * clipWidth * clipWidth;
11607
+ var endX = -r * Math.cos(endAngle + PI / 2) + x;
11608
+ var endY = -r * Math.sin(endAngle + PI / 2) + y;
11609
+ var startX = r * Math.cos(startAngle + PI / 2) + x;
11610
+ var startY = r * Math.sin(startAngle + PI / 2) + y;
11611
+ ctx.lineTo(endX, endY);
11612
+ ctx.lineTo(startX, startY);
11613
+ }
11614
+ }
11615
+ ctx.closePath();
11616
+ ctx.moveTo(0, 0);
11617
+ ctx.rect(0, 0, ctx.canvas.width, ctx.canvas.height);
11618
+ ctx.clip('evenodd');
11619
+ }
11538
11620
  function clipArc(ctx, element, endAngle) {
11539
11621
  var startAngle = element.startAngle,
11540
11622
  pixelMargin = element.pixelMargin,
@@ -11717,7 +11799,8 @@
11717
11799
  var borderWidth = options.borderWidth,
11718
11800
  borderJoinStyle = options.borderJoinStyle,
11719
11801
  borderDash = options.borderDash,
11720
- borderDashOffset = options.borderDashOffset;
11802
+ borderDashOffset = options.borderDashOffset,
11803
+ borderRadius = options.borderRadius;
11721
11804
  var inner = options.borderAlign === 'inner';
11722
11805
  if (!borderWidth) {
11723
11806
  return;
@@ -11744,6 +11827,9 @@
11744
11827
  if (inner) {
11745
11828
  clipArc(ctx, element, endAngle);
11746
11829
  }
11830
+ if (options.selfJoin && endAngle - startAngle >= PI && borderRadius === 0 && borderJoinStyle !== 'miter') {
11831
+ clipSelf(ctx, element, endAngle);
11832
+ }
11747
11833
  if (!fullCircles) {
11748
11834
  pathArc(ctx, element, offset, spacing, endAngle, circular);
11749
11835
  ctx.stroke();
@@ -11751,28 +11837,28 @@
11751
11837
  }
11752
11838
  var ArcElement = /*#__PURE__*/function (_Element3) {
11753
11839
  function ArcElement(cfg) {
11754
- var _this23;
11840
+ var _this21;
11755
11841
  _classCallCheck$1(this, ArcElement);
11756
- _this23 = _callSuper(this, ArcElement);
11757
- _defineProperty$1(_this23, "circumference", void 0);
11758
- _defineProperty$1(_this23, "endAngle", void 0);
11759
- _defineProperty$1(_this23, "fullCircles", void 0);
11760
- _defineProperty$1(_this23, "innerRadius", void 0);
11761
- _defineProperty$1(_this23, "outerRadius", void 0);
11762
- _defineProperty$1(_this23, "pixelMargin", void 0);
11763
- _defineProperty$1(_this23, "startAngle", void 0);
11764
- _this23.options = undefined;
11765
- _this23.circumference = undefined;
11766
- _this23.startAngle = undefined;
11767
- _this23.endAngle = undefined;
11768
- _this23.innerRadius = undefined;
11769
- _this23.outerRadius = undefined;
11770
- _this23.pixelMargin = 0;
11771
- _this23.fullCircles = 0;
11842
+ _this21 = _callSuper(this, ArcElement);
11843
+ _defineProperty$1(_this21, "circumference", void 0);
11844
+ _defineProperty$1(_this21, "endAngle", void 0);
11845
+ _defineProperty$1(_this21, "fullCircles", void 0);
11846
+ _defineProperty$1(_this21, "innerRadius", void 0);
11847
+ _defineProperty$1(_this21, "outerRadius", void 0);
11848
+ _defineProperty$1(_this21, "pixelMargin", void 0);
11849
+ _defineProperty$1(_this21, "startAngle", void 0);
11850
+ _this21.options = undefined;
11851
+ _this21.circumference = undefined;
11852
+ _this21.startAngle = undefined;
11853
+ _this21.endAngle = undefined;
11854
+ _this21.innerRadius = undefined;
11855
+ _this21.outerRadius = undefined;
11856
+ _this21.pixelMargin = 0;
11857
+ _this21.fullCircles = 0;
11772
11858
  if (cfg) {
11773
- Object.assign(_this23, cfg);
11859
+ Object.assign(_this21, cfg);
11774
11860
  }
11775
- return _this23;
11861
+ return _this21;
11776
11862
  }
11777
11863
  _inherits$1(ArcElement, _Element3);
11778
11864
  return _createClass$1(ArcElement, [{
@@ -11808,9 +11894,9 @@
11808
11894
  endAngle = _this$getProps3.endAngle,
11809
11895
  innerRadius = _this$getProps3.innerRadius,
11810
11896
  outerRadius = _this$getProps3.outerRadius;
11811
- var _this$options13 = this.options,
11812
- offset = _this$options13.offset,
11813
- spacing = _this$options13.spacing;
11897
+ var _this$options11 = this.options,
11898
+ offset = _this$options11.offset,
11899
+ spacing = _this$options11.spacing;
11814
11900
  var halfAngle = (startAngle + endAngle) / 2;
11815
11901
  var halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;
11816
11902
  return {
@@ -11861,7 +11947,8 @@
11861
11947
  offset: 0,
11862
11948
  spacing: 0,
11863
11949
  angle: undefined,
11864
- circular: true
11950
+ circular: true,
11951
+ selfJoin: false
11865
11952
  });
11866
11953
  _defineProperty$1(ArcElement, "defaultRoutes", {
11867
11954
  backgroundColor: 'backgroundColor'
@@ -12027,11 +12114,11 @@
12027
12114
  var segments = line.segments,
12028
12115
  options = line.options;
12029
12116
  var segmentMethod = _getSegmentMethod(line);
12030
- var _iterator16 = _createForOfIteratorHelper$1(segments),
12031
- _step16;
12117
+ var _iterator15 = _createForOfIteratorHelper$1(segments),
12118
+ _step15;
12032
12119
  try {
12033
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
12034
- var segment = _step16.value;
12120
+ for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
12121
+ var segment = _step15.value;
12035
12122
  setStyle(ctx, options, segment.style);
12036
12123
  ctx.beginPath();
12037
12124
  if (segmentMethod(ctx, line, segment, {
@@ -12043,9 +12130,9 @@
12043
12130
  ctx.stroke();
12044
12131
  }
12045
12132
  } catch (err) {
12046
- _iterator16.e(err);
12133
+ _iterator15.e(err);
12047
12134
  } finally {
12048
- _iterator16.f();
12135
+ _iterator15.f();
12049
12136
  }
12050
12137
  }
12051
12138
  var usePath2D = typeof Path2D === 'function';
@@ -12058,24 +12145,24 @@
12058
12145
  }
12059
12146
  var LineElement = /*#__PURE__*/function (_Element4) {
12060
12147
  function LineElement(cfg) {
12061
- var _this24;
12148
+ var _this22;
12062
12149
  _classCallCheck$1(this, LineElement);
12063
- _this24 = _callSuper(this, LineElement);
12064
- _this24.animated = true;
12065
- _this24.options = undefined;
12066
- _this24._chart = undefined;
12067
- _this24._loop = undefined;
12068
- _this24._fullLoop = undefined;
12069
- _this24._path = undefined;
12070
- _this24._points = undefined;
12071
- _this24._segments = undefined;
12072
- _this24._decimated = false;
12073
- _this24._pointsUpdated = false;
12074
- _this24._datasetIndex = undefined;
12150
+ _this22 = _callSuper(this, LineElement);
12151
+ _this22.animated = true;
12152
+ _this22.options = undefined;
12153
+ _this22._chart = undefined;
12154
+ _this22._loop = undefined;
12155
+ _this22._fullLoop = undefined;
12156
+ _this22._path = undefined;
12157
+ _this22._points = undefined;
12158
+ _this22._segments = undefined;
12159
+ _this22._decimated = false;
12160
+ _this22._pointsUpdated = false;
12161
+ _this22._datasetIndex = undefined;
12075
12162
  if (cfg) {
12076
- Object.assign(_this24, cfg);
12163
+ Object.assign(_this22, cfg);
12077
12164
  }
12078
- return _this24;
12165
+ return _this22;
12079
12166
  }
12080
12167
  _inherits$1(LineElement, _Element4);
12081
12168
  return _createClass$1(LineElement, [{
@@ -12167,20 +12254,20 @@
12167
12254
  var loop = this._loop;
12168
12255
  start = start || 0;
12169
12256
  count = count || this.points.length - start;
12170
- var _iterator17 = _createForOfIteratorHelper$1(segments),
12171
- _step17;
12257
+ var _iterator16 = _createForOfIteratorHelper$1(segments),
12258
+ _step16;
12172
12259
  try {
12173
- for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
12174
- var segment = _step17.value;
12260
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
12261
+ var segment = _step16.value;
12175
12262
  loop &= segmentMethod(ctx, this, segment, {
12176
12263
  start: start,
12177
12264
  end: start + count - 1
12178
12265
  });
12179
12266
  }
12180
12267
  } catch (err) {
12181
- _iterator17.e(err);
12268
+ _iterator16.e(err);
12182
12269
  } finally {
12183
- _iterator17.f();
12270
+ _iterator16.f();
12184
12271
  }
12185
12272
  return !!loop;
12186
12273
  }
@@ -12233,20 +12320,20 @@
12233
12320
  }
12234
12321
  var PointElement = /*#__PURE__*/function (_Element5) {
12235
12322
  function PointElement(cfg) {
12236
- var _this25;
12323
+ var _this23;
12237
12324
  _classCallCheck$1(this, PointElement);
12238
- _this25 = _callSuper(this, PointElement);
12239
- _defineProperty$1(_this25, "parsed", void 0);
12240
- _defineProperty$1(_this25, "skip", void 0);
12241
- _defineProperty$1(_this25, "stop", void 0);
12242
- _this25.options = undefined;
12243
- _this25.parsed = undefined;
12244
- _this25.skip = undefined;
12245
- _this25.stop = undefined;
12325
+ _this23 = _callSuper(this, PointElement);
12326
+ _defineProperty$1(_this23, "parsed", void 0);
12327
+ _defineProperty$1(_this23, "skip", void 0);
12328
+ _defineProperty$1(_this23, "stop", void 0);
12329
+ _this23.options = undefined;
12330
+ _this23.parsed = undefined;
12331
+ _this23.skip = undefined;
12332
+ _this23.stop = undefined;
12246
12333
  if (cfg) {
12247
- Object.assign(_this25, cfg);
12334
+ Object.assign(_this23, cfg);
12248
12335
  }
12249
- return _this25;
12336
+ return _this23;
12250
12337
  }
12251
12338
  _inherits$1(PointElement, _Element5);
12252
12339
  return _createClass$1(PointElement, [{
@@ -12443,28 +12530,28 @@
12443
12530
  }
12444
12531
  var BarElement = /*#__PURE__*/function (_Element6) {
12445
12532
  function BarElement(cfg) {
12446
- var _this26;
12533
+ var _this24;
12447
12534
  _classCallCheck$1(this, BarElement);
12448
- _this26 = _callSuper(this, BarElement);
12449
- _this26.options = undefined;
12450
- _this26.horizontal = undefined;
12451
- _this26.base = undefined;
12452
- _this26.width = undefined;
12453
- _this26.height = undefined;
12454
- _this26.inflateAmount = undefined;
12535
+ _this24 = _callSuper(this, BarElement);
12536
+ _this24.options = undefined;
12537
+ _this24.horizontal = undefined;
12538
+ _this24.base = undefined;
12539
+ _this24.width = undefined;
12540
+ _this24.height = undefined;
12541
+ _this24.inflateAmount = undefined;
12455
12542
  if (cfg) {
12456
- Object.assign(_this26, cfg);
12543
+ Object.assign(_this24, cfg);
12457
12544
  }
12458
- return _this26;
12545
+ return _this24;
12459
12546
  }
12460
12547
  _inherits$1(BarElement, _Element6);
12461
12548
  return _createClass$1(BarElement, [{
12462
12549
  key: "draw",
12463
12550
  value: function draw(ctx) {
12464
12551
  var inflateAmount = this.inflateAmount,
12465
- _this$options14 = this.options,
12466
- borderColor = _this$options14.borderColor,
12467
- backgroundColor = _this$options14.backgroundColor;
12552
+ _this$options12 = this.options,
12553
+ borderColor = _this$options12.borderColor,
12554
+ backgroundColor = _this$options12.backgroundColor;
12468
12555
  var _boundingRects = boundingRects(this),
12469
12556
  inner = _boundingRects.inner,
12470
12557
  outer = _boundingRects.outer;
@@ -12829,11 +12916,11 @@
12829
12916
  var points = line.points;
12830
12917
  var tpoints = target.points;
12831
12918
  var parts = [];
12832
- var _iterator18 = _createForOfIteratorHelper$1(segments),
12833
- _step18;
12919
+ var _iterator17 = _createForOfIteratorHelper$1(segments),
12920
+ _step17;
12834
12921
  try {
12835
- for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
12836
- var segment = _step18.value;
12922
+ for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
12923
+ var segment = _step17.value;
12837
12924
  var start = segment.start,
12838
12925
  end = segment.end;
12839
12926
  end = _findSegmentEnd(start, end, points);
@@ -12848,18 +12935,18 @@
12848
12935
  continue;
12849
12936
  }
12850
12937
  var targetSegments = _boundSegments(target, bounds);
12851
- var _iterator19 = _createForOfIteratorHelper$1(targetSegments),
12852
- _step19;
12938
+ var _iterator18 = _createForOfIteratorHelper$1(targetSegments),
12939
+ _step18;
12853
12940
  try {
12854
- for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
12855
- var tgt = _step19.value;
12941
+ for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
12942
+ var tgt = _step18.value;
12856
12943
  var subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);
12857
12944
  var fillSources = _boundSegment(segment, points, subBounds);
12858
- var _iterator20 = _createForOfIteratorHelper$1(fillSources),
12859
- _step20;
12945
+ var _iterator19 = _createForOfIteratorHelper$1(fillSources),
12946
+ _step19;
12860
12947
  try {
12861
- for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
12862
- var fillSource = _step20.value;
12948
+ for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
12949
+ var fillSource = _step19.value;
12863
12950
  parts.push({
12864
12951
  source: fillSource,
12865
12952
  target: tgt,
@@ -12868,21 +12955,21 @@
12868
12955
  });
12869
12956
  }
12870
12957
  } catch (err) {
12871
- _iterator20.e(err);
12958
+ _iterator19.e(err);
12872
12959
  } finally {
12873
- _iterator20.f();
12960
+ _iterator19.f();
12874
12961
  }
12875
12962
  }
12876
12963
  } catch (err) {
12877
- _iterator19.e(err);
12964
+ _iterator18.e(err);
12878
12965
  } finally {
12879
- _iterator19.f();
12966
+ _iterator18.f();
12880
12967
  }
12881
12968
  }
12882
12969
  } catch (err) {
12883
- _iterator18.e(err);
12970
+ _iterator17.e(err);
12884
12971
  } finally {
12885
- _iterator18.f();
12972
+ _iterator17.f();
12886
12973
  }
12887
12974
  return parts;
12888
12975
  }
@@ -13287,24 +13374,41 @@
13287
13374
  clip = cfg.clip;
13288
13375
  var property = line._loop ? 'angle' : cfg.axis;
13289
13376
  ctx.save();
13290
- if (property === 'x' && below !== above) {
13291
- clipVertical(ctx, target, area.top);
13292
- fill(ctx, {
13293
- line: line,
13294
- target: target,
13295
- color: above,
13296
- scale: scale,
13297
- property: property,
13298
- clip: clip
13299
- });
13300
- ctx.restore();
13301
- ctx.save();
13302
- clipVertical(ctx, target, area.bottom);
13377
+ var fillColor = below;
13378
+ if (below !== above) {
13379
+ if (property === 'x') {
13380
+ clipVertical(ctx, target, area.top);
13381
+ fill(ctx, {
13382
+ line: line,
13383
+ target: target,
13384
+ color: above,
13385
+ scale: scale,
13386
+ property: property,
13387
+ clip: clip
13388
+ });
13389
+ ctx.restore();
13390
+ ctx.save();
13391
+ clipVertical(ctx, target, area.bottom);
13392
+ } else if (property === 'y') {
13393
+ clipHorizontal(ctx, target, area.left);
13394
+ fill(ctx, {
13395
+ line: line,
13396
+ target: target,
13397
+ color: below,
13398
+ scale: scale,
13399
+ property: property,
13400
+ clip: clip
13401
+ });
13402
+ ctx.restore();
13403
+ ctx.save();
13404
+ clipHorizontal(ctx, target, area.right);
13405
+ fillColor = above;
13406
+ }
13303
13407
  }
13304
13408
  fill(ctx, {
13305
13409
  line: line,
13306
13410
  target: target,
13307
- color: below,
13411
+ color: fillColor,
13308
13412
  scale: scale,
13309
13413
  property: property,
13310
13414
  clip: clip
@@ -13312,6 +13416,46 @@
13312
13416
  ctx.restore();
13313
13417
  }
13314
13418
  function clipVertical(ctx, target, clipY) {
13419
+ var segments = target.segments,
13420
+ points = target.points;
13421
+ var first = true;
13422
+ var lineLoop = false;
13423
+ ctx.beginPath();
13424
+ var _iterator20 = _createForOfIteratorHelper$1(segments),
13425
+ _step20;
13426
+ try {
13427
+ for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
13428
+ var segment = _step20.value;
13429
+ var start = segment.start,
13430
+ end = segment.end;
13431
+ var firstPoint = points[start];
13432
+ var lastPoint = points[_findSegmentEnd(start, end, points)];
13433
+ if (first) {
13434
+ ctx.moveTo(firstPoint.x, firstPoint.y);
13435
+ first = false;
13436
+ } else {
13437
+ ctx.lineTo(firstPoint.x, clipY);
13438
+ ctx.lineTo(firstPoint.x, firstPoint.y);
13439
+ }
13440
+ lineLoop = !!target.pathSegment(ctx, segment, {
13441
+ move: lineLoop
13442
+ });
13443
+ if (lineLoop) {
13444
+ ctx.closePath();
13445
+ } else {
13446
+ ctx.lineTo(lastPoint.x, clipY);
13447
+ }
13448
+ }
13449
+ } catch (err) {
13450
+ _iterator20.e(err);
13451
+ } finally {
13452
+ _iterator20.f();
13453
+ }
13454
+ ctx.lineTo(target.first().x, clipY);
13455
+ ctx.closePath();
13456
+ ctx.clip();
13457
+ }
13458
+ function clipHorizontal(ctx, target, clipX) {
13315
13459
  var segments = target.segments,
13316
13460
  points = target.points;
13317
13461
  var first = true;
@@ -13330,7 +13474,7 @@
13330
13474
  ctx.moveTo(firstPoint.x, firstPoint.y);
13331
13475
  first = false;
13332
13476
  } else {
13333
- ctx.lineTo(firstPoint.x, clipY);
13477
+ ctx.lineTo(clipX, firstPoint.y);
13334
13478
  ctx.lineTo(firstPoint.x, firstPoint.y);
13335
13479
  }
13336
13480
  lineLoop = !!target.pathSegment(ctx, segment, {
@@ -13339,7 +13483,7 @@
13339
13483
  if (lineLoop) {
13340
13484
  ctx.closePath();
13341
13485
  } else {
13342
- ctx.lineTo(lastPoint.x, clipY);
13486
+ ctx.lineTo(clipX, lastPoint.y);
13343
13487
  }
13344
13488
  }
13345
13489
  } catch (err) {
@@ -13347,7 +13491,7 @@
13347
13491
  } finally {
13348
13492
  _iterator21.f();
13349
13493
  }
13350
- ctx.lineTo(target.first().x, clipY);
13494
+ ctx.lineTo(clipX, target.first().y);
13351
13495
  ctx.closePath();
13352
13496
  ctx.clip();
13353
13497
  }
@@ -13406,10 +13550,10 @@
13406
13550
  }
13407
13551
  function clipBounds(ctx, scale, clip, bounds) {
13408
13552
  var chartArea = scale.chart.chartArea;
13409
- var _ref10 = bounds || {},
13410
- property = _ref10.property,
13411
- start = _ref10.start,
13412
- end = _ref10.end;
13553
+ var _ref0 = bounds || {},
13554
+ property = _ref0.property,
13555
+ start = _ref0.start,
13556
+ end = _ref0.end;
13413
13557
  if (property === 'x' || property === 'y') {
13414
13558
  var left, top, right, bottom;
13415
13559
  if (property === 'x') {
@@ -13531,32 +13675,32 @@
13531
13675
  };
13532
13676
  var Legend = /*#__PURE__*/function (_Element7) {
13533
13677
  function Legend(config) {
13534
- var _this27;
13678
+ var _this25;
13535
13679
  _classCallCheck$1(this, Legend);
13536
- _this27 = _callSuper(this, Legend);
13537
- _this27._added = false;
13538
- _this27.legendHitBoxes = [];
13539
- _this27._hoveredItem = null;
13540
- _this27.doughnutMode = false;
13541
- _this27.chart = config.chart;
13542
- _this27.options = config.options;
13543
- _this27.ctx = config.ctx;
13544
- _this27.legendItems = undefined;
13545
- _this27.columnSizes = undefined;
13546
- _this27.lineWidths = undefined;
13547
- _this27.maxHeight = undefined;
13548
- _this27.maxWidth = undefined;
13549
- _this27.top = undefined;
13550
- _this27.bottom = undefined;
13551
- _this27.left = undefined;
13552
- _this27.right = undefined;
13553
- _this27.height = undefined;
13554
- _this27.width = undefined;
13555
- _this27._margins = undefined;
13556
- _this27.position = undefined;
13557
- _this27.weight = undefined;
13558
- _this27.fullSize = undefined;
13559
- return _this27;
13680
+ _this25 = _callSuper(this, Legend);
13681
+ _this25._added = false;
13682
+ _this25.legendHitBoxes = [];
13683
+ _this25._hoveredItem = null;
13684
+ _this25.doughnutMode = false;
13685
+ _this25.chart = config.chart;
13686
+ _this25.options = config.options;
13687
+ _this25.ctx = config.ctx;
13688
+ _this25.legendItems = undefined;
13689
+ _this25.columnSizes = undefined;
13690
+ _this25.lineWidths = undefined;
13691
+ _this25.maxHeight = undefined;
13692
+ _this25.maxWidth = undefined;
13693
+ _this25.top = undefined;
13694
+ _this25.bottom = undefined;
13695
+ _this25.left = undefined;
13696
+ _this25.right = undefined;
13697
+ _this25.height = undefined;
13698
+ _this25.width = undefined;
13699
+ _this25._margins = undefined;
13700
+ _this25.position = undefined;
13701
+ _this25.weight = undefined;
13702
+ _this25.fullSize = undefined;
13703
+ return _this25;
13560
13704
  }
13561
13705
  _inherits$1(Legend, _Element7);
13562
13706
  return _createClass$1(Legend, [{
@@ -13585,17 +13729,17 @@
13585
13729
  }, {
13586
13730
  key: "buildLabels",
13587
13731
  value: function buildLabels() {
13588
- var _this28 = this;
13732
+ var _this26 = this;
13589
13733
  var labelOpts = this.options.labels || {};
13590
13734
  var legendItems = callback(labelOpts.generateLabels, [this.chart], this) || [];
13591
13735
  if (labelOpts.filter) {
13592
13736
  legendItems = legendItems.filter(function (item) {
13593
- return labelOpts.filter(item, _this28.chart.data);
13737
+ return labelOpts.filter(item, _this26.chart.data);
13594
13738
  });
13595
13739
  }
13596
13740
  if (labelOpts.sort) {
13597
13741
  legendItems = legendItems.sort(function (a, b) {
13598
- return labelOpts.sort(a, b, _this28.chart.data);
13742
+ return labelOpts.sort(a, b, _this26.chart.data);
13599
13743
  });
13600
13744
  }
13601
13745
  if (this.options.reverse) {
@@ -13717,10 +13861,10 @@
13717
13861
  }
13718
13862
  var titleHeight = this._computeTitleHeight();
13719
13863
  var hitboxes = this.legendHitBoxes,
13720
- _this$options15 = this.options,
13721
- align = _this$options15.align,
13722
- padding = _this$options15.labels.padding,
13723
- rtl = _this$options15.rtl;
13864
+ _this$options13 = this.options,
13865
+ align = _this$options13.align,
13866
+ padding = _this$options13.labels.padding,
13867
+ rtl = _this$options13.rtl;
13724
13868
  var rtlHelper = getRtlAdapter(rtl, this.left, this.width);
13725
13869
  if (this.isHorizontal()) {
13726
13870
  var row = 0;
@@ -13785,7 +13929,7 @@
13785
13929
  }, {
13786
13930
  key: "_draw",
13787
13931
  value: function _draw() {
13788
- var _this29 = this;
13932
+ var _this27 = this;
13789
13933
  var opts = this.options,
13790
13934
  columnSizes = this.columnSizes,
13791
13935
  lineWidths = this.lineWidths,
@@ -13887,21 +14031,21 @@
13887
14031
  var width = boxWidth + halfFontSize + textWidth;
13888
14032
  var x = cursor.x;
13889
14033
  var y = cursor.y;
13890
- rtlHelper.setWidth(_this29.width);
14034
+ rtlHelper.setWidth(_this27.width);
13891
14035
  if (isHorizontal) {
13892
- if (i > 0 && x + width + padding > _this29.right) {
14036
+ if (i > 0 && x + width + padding > _this27.right) {
13893
14037
  y = cursor.y += lineHeight;
13894
14038
  cursor.line++;
13895
- x = cursor.x = _alignStartEnd(align, _this29.left + padding, _this29.right - lineWidths[cursor.line]);
14039
+ x = cursor.x = _alignStartEnd(align, _this27.left + padding, _this27.right - lineWidths[cursor.line]);
13896
14040
  }
13897
- } else if (i > 0 && y + lineHeight > _this29.bottom) {
14041
+ } else if (i > 0 && y + lineHeight > _this27.bottom) {
13898
14042
  x = cursor.x = x + columnSizes[cursor.line].width + padding;
13899
14043
  cursor.line++;
13900
- y = cursor.y = _alignStartEnd(align, _this29.top + titleHeight + padding, _this29.bottom - columnSizes[cursor.line].height);
14044
+ y = cursor.y = _alignStartEnd(align, _this27.top + titleHeight + padding, _this27.bottom - columnSizes[cursor.line].height);
13901
14045
  }
13902
14046
  var realX = rtlHelper.x(x);
13903
14047
  drawLegendBox(realX, y, legendItem);
13904
- x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : _this29.right, opts.rtl);
14048
+ x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : _this27.right, opts.rtl);
13905
14049
  fillText(rtlHelper.x(x), y, legendItem);
13906
14050
  if (isHorizontal) {
13907
14051
  cursor.x += width + padding;
@@ -14145,23 +14289,23 @@
14145
14289
  };
14146
14290
  var Title = /*#__PURE__*/function (_Element8) {
14147
14291
  function Title(config) {
14148
- var _this30;
14292
+ var _this28;
14149
14293
  _classCallCheck$1(this, Title);
14150
- _this30 = _callSuper(this, Title);
14151
- _this30.chart = config.chart;
14152
- _this30.options = config.options;
14153
- _this30.ctx = config.ctx;
14154
- _this30._padding = undefined;
14155
- _this30.top = undefined;
14156
- _this30.bottom = undefined;
14157
- _this30.left = undefined;
14158
- _this30.right = undefined;
14159
- _this30.width = undefined;
14160
- _this30.height = undefined;
14161
- _this30.position = undefined;
14162
- _this30.weight = undefined;
14163
- _this30.fullSize = undefined;
14164
- return _this30;
14294
+ _this28 = _callSuper(this, Title);
14295
+ _this28.chart = config.chart;
14296
+ _this28.options = config.options;
14297
+ _this28.ctx = config.ctx;
14298
+ _this28._padding = undefined;
14299
+ _this28.top = undefined;
14300
+ _this28.bottom = undefined;
14301
+ _this28.left = undefined;
14302
+ _this28.right = undefined;
14303
+ _this28.width = undefined;
14304
+ _this28.height = undefined;
14305
+ _this28.position = undefined;
14306
+ _this28.weight = undefined;
14307
+ _this28.fullSize = undefined;
14308
+ return _this28;
14165
14309
  }
14166
14310
  _inherits$1(Title, _Element8);
14167
14311
  return _createClass$1(Title, [{
@@ -14680,37 +14824,37 @@
14680
14824
  }
14681
14825
  var Tooltip = /*#__PURE__*/function (_Element9) {
14682
14826
  function Tooltip(config) {
14683
- var _this31;
14827
+ var _this29;
14684
14828
  _classCallCheck$1(this, Tooltip);
14685
- _this31 = _callSuper(this, Tooltip);
14686
- _this31.opacity = 0;
14687
- _this31._active = [];
14688
- _this31._eventPosition = undefined;
14689
- _this31._size = undefined;
14690
- _this31._cachedAnimations = undefined;
14691
- _this31._tooltipItems = [];
14692
- _this31.$animations = undefined;
14693
- _this31.$context = undefined;
14694
- _this31.chart = config.chart;
14695
- _this31.options = config.options;
14696
- _this31.dataPoints = undefined;
14697
- _this31.title = undefined;
14698
- _this31.beforeBody = undefined;
14699
- _this31.body = undefined;
14700
- _this31.afterBody = undefined;
14701
- _this31.footer = undefined;
14702
- _this31.xAlign = undefined;
14703
- _this31.yAlign = undefined;
14704
- _this31.x = undefined;
14705
- _this31.y = undefined;
14706
- _this31.height = undefined;
14707
- _this31.width = undefined;
14708
- _this31.caretX = undefined;
14709
- _this31.caretY = undefined;
14710
- _this31.labelColors = undefined;
14711
- _this31.labelPointStyles = undefined;
14712
- _this31.labelTextColors = undefined;
14713
- return _this31;
14829
+ _this29 = _callSuper(this, Tooltip);
14830
+ _this29.opacity = 0;
14831
+ _this29._active = [];
14832
+ _this29._eventPosition = undefined;
14833
+ _this29._size = undefined;
14834
+ _this29._cachedAnimations = undefined;
14835
+ _this29._tooltipItems = [];
14836
+ _this29.$animations = undefined;
14837
+ _this29.$context = undefined;
14838
+ _this29.chart = config.chart;
14839
+ _this29.options = config.options;
14840
+ _this29.dataPoints = undefined;
14841
+ _this29.title = undefined;
14842
+ _this29.beforeBody = undefined;
14843
+ _this29.body = undefined;
14844
+ _this29.afterBody = undefined;
14845
+ _this29.footer = undefined;
14846
+ _this29.xAlign = undefined;
14847
+ _this29.yAlign = undefined;
14848
+ _this29.x = undefined;
14849
+ _this29.y = undefined;
14850
+ _this29.height = undefined;
14851
+ _this29.width = undefined;
14852
+ _this29.caretX = undefined;
14853
+ _this29.caretY = undefined;
14854
+ _this29.labelColors = undefined;
14855
+ _this29.labelPointStyles = undefined;
14856
+ _this29.labelTextColors = undefined;
14857
+ return _this29;
14714
14858
  }
14715
14859
  _inherits$1(Tooltip, _Element9);
14716
14860
  return _createClass$1(Tooltip, [{
@@ -14762,7 +14906,7 @@
14762
14906
  }, {
14763
14907
  key: "getBody",
14764
14908
  value: function getBody(tooltipItems, options) {
14765
- var _this32 = this;
14909
+ var _this30 = this;
14766
14910
  var callbacks = options.callbacks;
14767
14911
  var bodyItems = [];
14768
14912
  each(tooltipItems, function (context) {
@@ -14772,9 +14916,9 @@
14772
14916
  after: []
14773
14917
  };
14774
14918
  var scoped = overrideCallbacks(callbacks, context);
14775
- pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', _this32, context)));
14776
- pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', _this32, context));
14777
- pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', _this32, context)));
14919
+ pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', _this30, context)));
14920
+ pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', _this30, context));
14921
+ pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', _this30, context)));
14778
14922
  bodyItems.push(bodyItem);
14779
14923
  });
14780
14924
  return bodyItems;
@@ -14800,7 +14944,7 @@
14800
14944
  }, {
14801
14945
  key: "_createItems",
14802
14946
  value: function _createItems(options) {
14803
- var _this33 = this;
14947
+ var _this31 = this;
14804
14948
  var active = this._active;
14805
14949
  var data = this.chart.data;
14806
14950
  var labelColors = [];
@@ -14823,9 +14967,9 @@
14823
14967
  }
14824
14968
  each(tooltipItems, function (context) {
14825
14969
  var scoped = overrideCallbacks(options.callbacks, context);
14826
- labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', _this33, context));
14827
- labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', _this33, context));
14828
- labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', _this33, context));
14970
+ labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', _this31, context));
14971
+ labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', _this31, context));
14972
+ labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', _this31, context));
14829
14973
  });
14830
14974
  this.labelColors = labelColors;
14831
14975
  this.labelPointStyles = labelPointStyles;
@@ -15232,12 +15376,12 @@
15232
15376
  }, {
15233
15377
  key: "setActiveElements",
15234
15378
  value: function setActiveElements(activeElements, eventPosition) {
15235
- var _this34 = this;
15379
+ var _this32 = this;
15236
15380
  var lastActive = this._active;
15237
- var active = activeElements.map(function (_ref11) {
15238
- var datasetIndex = _ref11.datasetIndex,
15239
- index = _ref11.index;
15240
- var meta = _this34.chart.getDatasetMeta(datasetIndex);
15381
+ var active = activeElements.map(function (_ref1) {
15382
+ var datasetIndex = _ref1.datasetIndex,
15383
+ index = _ref1.index;
15384
+ var meta = _this32.chart.getDatasetMeta(datasetIndex);
15241
15385
  if (!meta) {
15242
15386
  throw new Error('Cannot find a dataset at index ' + datasetIndex);
15243
15387
  }
@@ -15284,14 +15428,14 @@
15284
15428
  }, {
15285
15429
  key: "_getActiveElements",
15286
15430
  value: function _getActiveElements(e, lastActive, replay, inChartArea) {
15287
- var _this35 = this;
15431
+ var _this33 = this;
15288
15432
  var options = this.options;
15289
15433
  if (e.type === 'mouseout') {
15290
15434
  return [];
15291
15435
  }
15292
15436
  if (!inChartArea) {
15293
15437
  return lastActive.filter(function (i) {
15294
- return _this35.chart.data.datasets[i.datasetIndex] && _this35.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined;
15438
+ return _this33.chart.data.datasets[i.datasetIndex] && _this33.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined;
15295
15439
  });
15296
15440
  }
15297
15441
  var active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);
@@ -15476,13 +15620,13 @@
15476
15620
  }
15477
15621
  var CategoryScale = /*#__PURE__*/function (_Scale) {
15478
15622
  function CategoryScale(cfg) {
15479
- var _this36;
15623
+ var _this34;
15480
15624
  _classCallCheck$1(this, CategoryScale);
15481
- _this36 = _callSuper(this, CategoryScale, [cfg]);
15482
- _this36._startValue = undefined;
15483
- _this36._valueRange = 0;
15484
- _this36._addedLabels = [];
15485
- return _this36;
15625
+ _this34 = _callSuper(this, CategoryScale, [cfg]);
15626
+ _this34._startValue = undefined;
15627
+ _this34._valueRange = 0;
15628
+ _this34._addedLabels = [];
15629
+ return _this34;
15486
15630
  }
15487
15631
  _inherits$1(CategoryScale, _Scale);
15488
15632
  return _createClass$1(CategoryScale, [{
@@ -15713,9 +15857,9 @@
15713
15857
  }
15714
15858
  return ticks;
15715
15859
  }
15716
- function relativeLabelSize(value, minSpacing, _ref12) {
15717
- var horizontal = _ref12.horizontal,
15718
- minRotation = _ref12.minRotation;
15860
+ function relativeLabelSize(value, minSpacing, _ref10) {
15861
+ var horizontal = _ref10.horizontal,
15862
+ minRotation = _ref10.minRotation;
15719
15863
  var rad = toRadians(minRotation);
15720
15864
  var ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;
15721
15865
  var length = 0.75 * minSpacing * ('' + value).length;
@@ -15723,15 +15867,15 @@
15723
15867
  }
15724
15868
  var LinearScaleBase = /*#__PURE__*/function (_Scale2) {
15725
15869
  function LinearScaleBase(cfg) {
15726
- var _this37;
15870
+ var _this35;
15727
15871
  _classCallCheck$1(this, LinearScaleBase);
15728
- _this37 = _callSuper(this, LinearScaleBase, [cfg]);
15729
- _this37.start = undefined;
15730
- _this37.end = undefined;
15731
- _this37._startValue = undefined;
15732
- _this37._endValue = undefined;
15733
- _this37._valueRange = 0;
15734
- return _this37;
15872
+ _this35 = _callSuper(this, LinearScaleBase, [cfg]);
15873
+ _this35.start = undefined;
15874
+ _this35.end = undefined;
15875
+ _this35._startValue = undefined;
15876
+ _this35._endValue = undefined;
15877
+ _this35._valueRange = 0;
15878
+ return _this35;
15735
15879
  }
15736
15880
  _inherits$1(LinearScaleBase, _Scale2);
15737
15881
  return _createClass$1(LinearScaleBase, [{
@@ -15935,9 +16079,9 @@
15935
16079
  }
15936
16080
  return Math.min(rangeExp, log10Floor(min));
15937
16081
  }
15938
- function generateTicks(generationOptions, _ref13) {
15939
- var min = _ref13.min,
15940
- max = _ref13.max;
16082
+ function generateTicks(generationOptions, _ref11) {
16083
+ var min = _ref11.min,
16084
+ max = _ref11.max;
15941
16085
  min = finiteOrDefault(generationOptions.min, min);
15942
16086
  var ticks = [];
15943
16087
  var minExp = log10Floor(min);
@@ -15977,14 +16121,14 @@
15977
16121
  }
15978
16122
  var LogarithmicScale = /*#__PURE__*/function (_Scale3) {
15979
16123
  function LogarithmicScale(cfg) {
15980
- var _this38;
16124
+ var _this36;
15981
16125
  _classCallCheck$1(this, LogarithmicScale);
15982
- _this38 = _callSuper(this, LogarithmicScale, [cfg]);
15983
- _this38.start = undefined;
15984
- _this38.end = undefined;
15985
- _this38._startValue = undefined;
15986
- _this38._valueRange = 0;
15987
- return _this38;
16126
+ _this36 = _callSuper(this, LogarithmicScale, [cfg]);
16127
+ _this36.start = undefined;
16128
+ _this36.end = undefined;
16129
+ _this36._startValue = undefined;
16130
+ _this36._valueRange = 0;
16131
+ return _this36;
15988
16132
  }
15989
16133
  _inherits$1(LogarithmicScale, _Scale3);
15990
16134
  return _createClass$1(LogarithmicScale, [{
@@ -16377,15 +16521,15 @@
16377
16521
  }
16378
16522
  var RadialLinearScale = /*#__PURE__*/function (_LinearScaleBase2) {
16379
16523
  function RadialLinearScale(cfg) {
16380
- var _this39;
16524
+ var _this37;
16381
16525
  _classCallCheck$1(this, RadialLinearScale);
16382
- _this39 = _callSuper(this, RadialLinearScale, [cfg]);
16383
- _this39.xCenter = undefined;
16384
- _this39.yCenter = undefined;
16385
- _this39.drawingArea = undefined;
16386
- _this39._pointLabels = [];
16387
- _this39._pointLabelItems = [];
16388
- return _this39;
16526
+ _this37 = _callSuper(this, RadialLinearScale, [cfg]);
16527
+ _this37.xCenter = undefined;
16528
+ _this37.yCenter = undefined;
16529
+ _this37.drawingArea = undefined;
16530
+ _this37._pointLabels = [];
16531
+ _this37._pointLabelItems = [];
16532
+ return _this37;
16389
16533
  }
16390
16534
  _inherits$1(RadialLinearScale, _LinearScaleBase2);
16391
16535
  return _createClass$1(RadialLinearScale, [{
@@ -16416,13 +16560,13 @@
16416
16560
  }, {
16417
16561
  key: "generateTickLabels",
16418
16562
  value: function generateTickLabels(ticks) {
16419
- var _this40 = this;
16563
+ var _this38 = this;
16420
16564
  LinearScaleBase.prototype.generateTickLabels.call(this, ticks);
16421
16565
  this._pointLabels = this.getLabels().map(function (value, index) {
16422
- var label = callback(_this40.options.pointLabels.callback, [value, index], _this40);
16566
+ var label = callback(_this38.options.pointLabels.callback, [value, index], _this38);
16423
16567
  return label || label === 0 ? label : '';
16424
16568
  }).filter(function (v, i) {
16425
- return _this40.chart.getDataVisibility(i);
16569
+ return _this38.chart.getDataVisibility(i);
16426
16570
  });
16427
16571
  }
16428
16572
  }, {
@@ -16518,9 +16662,9 @@
16518
16662
  }, {
16519
16663
  key: "drawBackground",
16520
16664
  value: function drawBackground() {
16521
- var _this$options16 = this.options,
16522
- backgroundColor = _this$options16.backgroundColor,
16523
- circular = _this$options16.grid.circular;
16665
+ var _this$options14 = this.options,
16666
+ backgroundColor = _this$options14.backgroundColor,
16667
+ circular = _this$options14.grid.circular;
16524
16668
  if (backgroundColor) {
16525
16669
  var ctx = this.ctx;
16526
16670
  ctx.save();
@@ -16535,7 +16679,7 @@
16535
16679
  }, {
16536
16680
  key: "drawGrid",
16537
16681
  value: function drawGrid() {
16538
- var _this41 = this;
16682
+ var _this39 = this;
16539
16683
  var ctx = this.ctx;
16540
16684
  var opts = this.options;
16541
16685
  var angleLines = opts.angleLines,
@@ -16548,12 +16692,12 @@
16548
16692
  }
16549
16693
  if (grid.display) {
16550
16694
  this.ticks.forEach(function (tick, index) {
16551
- if (index !== 0 || index === 0 && _this41.min < 0) {
16552
- offset = _this41.getDistanceFromCenterForValue(tick.value);
16553
- var context = _this41.getContext(index);
16695
+ if (index !== 0 || index === 0 && _this39.min < 0) {
16696
+ offset = _this39.getDistanceFromCenterForValue(tick.value);
16697
+ var context = _this39.getContext(index);
16554
16698
  var optsAtIndex = grid.setContext(context);
16555
16699
  var optsAtIndexBorder = border.setContext(context);
16556
- drawRadiusLine(_this41, optsAtIndex, offset, labelCount, optsAtIndexBorder);
16700
+ drawRadiusLine(_this39, optsAtIndex, offset, labelCount, optsAtIndexBorder);
16557
16701
  }
16558
16702
  });
16559
16703
  }
@@ -16586,7 +16730,7 @@
16586
16730
  }, {
16587
16731
  key: "drawLabels",
16588
16732
  value: function drawLabels() {
16589
- var _this42 = this;
16733
+ var _this40 = this;
16590
16734
  var ctx = this.ctx;
16591
16735
  var opts = this.options;
16592
16736
  var tickOpts = opts.ticks;
@@ -16601,12 +16745,12 @@
16601
16745
  ctx.textAlign = 'center';
16602
16746
  ctx.textBaseline = 'middle';
16603
16747
  this.ticks.forEach(function (tick, index) {
16604
- if (index === 0 && _this42.min >= 0 && !opts.reverse) {
16748
+ if (index === 0 && _this40.min >= 0 && !opts.reverse) {
16605
16749
  return;
16606
16750
  }
16607
- var optsAtIndex = tickOpts.setContext(_this42.getContext(index));
16751
+ var optsAtIndex = tickOpts.setContext(_this40.getContext(index));
16608
16752
  var tickFont = toFont(optsAtIndex.font);
16609
- offset = _this42.getDistanceFromCenterForValue(_this42.ticks[index].value);
16753
+ offset = _this40.getDistanceFromCenterForValue(_this40.ticks[index].value);
16610
16754
  if (optsAtIndex.showLabelBackdrop) {
16611
16755
  ctx.font = tickFont.string;
16612
16756
  width = ctx.measureText(tick.label).width;
@@ -16812,20 +16956,20 @@
16812
16956
  }
16813
16957
  var TimeScale = /*#__PURE__*/function (_Scale4) {
16814
16958
  function TimeScale(props) {
16815
- var _this43;
16959
+ var _this41;
16816
16960
  _classCallCheck$1(this, TimeScale);
16817
- _this43 = _callSuper(this, TimeScale, [props]);
16818
- _this43._cache = {
16961
+ _this41 = _callSuper(this, TimeScale, [props]);
16962
+ _this41._cache = {
16819
16963
  data: [],
16820
16964
  labels: [],
16821
16965
  all: []
16822
16966
  };
16823
- _this43._unit = 'day';
16824
- _this43._majorUnit = undefined;
16825
- _this43._offsets = {};
16826
- _this43._normalized = false;
16827
- _this43._parseOpts = undefined;
16828
- return _this43;
16967
+ _this41._unit = 'day';
16968
+ _this41._majorUnit = undefined;
16969
+ _this41._offsets = {};
16970
+ _this41._normalized = false;
16971
+ _this41._parseOpts = undefined;
16972
+ return _this41;
16829
16973
  }
16830
16974
  _inherits$1(TimeScale, _Scale4);
16831
16975
  return _createClass$1(TimeScale, [{
@@ -17182,13 +17326,13 @@
17182
17326
  }
17183
17327
  var TimeSeriesScale = /*#__PURE__*/function (_TimeScale2) {
17184
17328
  function TimeSeriesScale(props) {
17185
- var _this44;
17329
+ var _this42;
17186
17330
  _classCallCheck$1(this, TimeSeriesScale);
17187
- _this44 = _callSuper(this, TimeSeriesScale, [props]);
17188
- _this44._table = [];
17189
- _this44._minPos = undefined;
17190
- _this44._tableRange = undefined;
17191
- return _this44;
17331
+ _this42 = _callSuper(this, TimeSeriesScale, [props]);
17332
+ _this42._table = [];
17333
+ _this42._minPos = undefined;
17334
+ _this42._tableRange = undefined;
17335
+ return _this42;
17192
17336
  }
17193
17337
  _inherits$1(TimeSeriesScale, _TimeScale2);
17194
17338
  return _createClass$1(TimeSeriesScale, [{