awing-library 2.1.78-beta → 2.1.79-beta

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.
@@ -8,7 +8,7 @@ var chartColorDefaults = [
8
8
  '#dd040c',
9
9
  '#aed6dc',
10
10
  '#ff9a8d',
11
- '#4a536b'
11
+ '#4a536b',
12
12
  ];
13
13
  var PieComponent = function (_a) {
14
14
  var chart = _a.chart, data = _a.data, _b = _a.dataConvert, dataConvert = _b === void 0 ? {
@@ -21,7 +21,23 @@ var PieComponent = function (_a) {
21
21
  borderWidth: 2,
22
22
  },
23
23
  ],
24
- } : _b, _c = _a.widthChart, widthChart = _c === void 0 ? 300 : _c, _d = _a.heightChart, heightChart = _d === void 0 ? 300 : _d, _e = _a.optionCustom, optionCustom = _e === void 0 ? {} : _e, _f = _a.options, options = _f === void 0 ? {
24
+ } : _b, _c = _a.widthChart, widthChart = _c === void 0 ? 300 : _c, _d = _a.heightChart, heightChart = _d === void 0 ? 300 : _d, _e = _a.optionCustom, optionCustom = _e === void 0 ? {
25
+ plugins: {
26
+ datalabels: {
27
+ anchor: 'end',
28
+ align: 'right',
29
+ formatter: function (value, ctx) {
30
+ var totalSum = ctx.dataset.data.reduce(function (acc, curr) {
31
+ return acc + curr;
32
+ }, 0);
33
+ console.log('totalSum', totalSum);
34
+ var percentage = (value / totalSum) * 100;
35
+ console.log('percentage', percentage);
36
+ return "(".concat(percentage.toFixed(1), "%)");
37
+ },
38
+ },
39
+ },
40
+ } : _e, _f = _a.options, options = _f === void 0 ? {
25
41
  responsive: true,
26
42
  elements: {
27
43
  arc: {
@@ -515,6 +515,9 @@ var updateObjectFields = function (originalObj, changedValues) {
515
515
  obj[key] = value;
516
516
  }
517
517
  }
518
+ else {
519
+ obj[key] = value;
520
+ }
518
521
  }
519
522
  };
520
523
  // Update nested fields
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.78-beta",
3
+ "version": "2.1.79-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",