intelicoreact 1.1.71 → 1.1.73
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.
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _reactChartjs = require("react-chartjs-2");
|
|
13
|
+
|
|
14
|
+
var _chart = require("chart.js");
|
|
15
|
+
|
|
16
|
+
require("./PieChart.scss");
|
|
17
|
+
|
|
18
|
+
_chart.Chart.register(_chart.ArcElement, _chart.Tooltip, _chart.Legend);
|
|
19
|
+
|
|
20
|
+
var PieChart = function PieChart(_ref) {
|
|
21
|
+
var data = _ref.data,
|
|
22
|
+
_ref$cutout = _ref.cutout,
|
|
23
|
+
cutout = _ref$cutout === void 0 ? '80%' : _ref$cutout,
|
|
24
|
+
resultLabel = _ref.resultLabel,
|
|
25
|
+
_ref$resultValue = _ref.resultValue,
|
|
26
|
+
resultValue = _ref$resultValue === void 0 ? 0 : _ref$resultValue,
|
|
27
|
+
_ref$withLegend = _ref.withLegend,
|
|
28
|
+
withLegend = _ref$withLegend === void 0 ? false : _ref$withLegend;
|
|
29
|
+
var options = {
|
|
30
|
+
cutout: cutout,
|
|
31
|
+
plugins: {
|
|
32
|
+
legend: {
|
|
33
|
+
display: withLegend
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
+
className: "pie-chart-box",
|
|
39
|
+
style: {
|
|
40
|
+
maxWidth: "320px"
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_reactChartjs.Pie, {
|
|
43
|
+
data: data,
|
|
44
|
+
options: options
|
|
45
|
+
}), !!resultLabel && /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
+
className: "pie-chart__result"
|
|
47
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
48
|
+
className: "pie-chart__result-value"
|
|
49
|
+
}, resultValue, /*#__PURE__*/_react.default.createElement("span", {
|
|
50
|
+
className: "pie-chart__result-percent"
|
|
51
|
+
}, "%"), ' '), /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
+
className: "pie-chart__result-label"
|
|
53
|
+
}, resultLabel)));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var _default = PieChart;
|
|
57
|
+
exports.default = _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.pie-chart-box {
|
|
2
|
+
max-width: 100%;
|
|
3
|
+
width: 180px;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
.pie-chart__result {
|
|
7
|
+
position: absolute;
|
|
8
|
+
left: 50%;
|
|
9
|
+
top: 50%;
|
|
10
|
+
transform: translateX(-50%) translateY(-50%);
|
|
11
|
+
text-align: center;
|
|
12
|
+
}
|
|
13
|
+
.pie-chart__result-value {
|
|
14
|
+
font-family: inherit;
|
|
15
|
+
font-size: 24px;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
line-height: 34px;
|
|
18
|
+
letter-spacing: 0;
|
|
19
|
+
}
|
|
20
|
+
.pie-chart__result-percent {
|
|
21
|
+
font-family: inherit;
|
|
22
|
+
font-size: 18px;
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
line-height: 25px;
|
|
25
|
+
letter-spacing: 0;
|
|
26
|
+
color: #7A8599;
|
|
27
|
+
margin-right: -14px;
|
|
28
|
+
display: inline-block;
|
|
29
|
+
transform: translateY(-5px) translateX(2px);
|
|
30
|
+
}
|
|
31
|
+
.pie-chart__result-label {
|
|
32
|
+
font-family: inherit;
|
|
33
|
+
font-size: 12px;
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
line-height: 24px;
|
|
36
|
+
letter-spacing: 0;
|
|
37
|
+
color: #9AA0B9;
|
|
38
|
+
text-transform: uppercase;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
|
|
41
|
+
}
|