@cashub/ui 0.48.5 → 0.48.7
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/chart/BarChart.js +10 -1
- package/package.json +1 -1
package/chart/BarChart.js
CHANGED
|
@@ -52,6 +52,10 @@ const BarChart = _ref => {
|
|
|
52
52
|
responsive: true,
|
|
53
53
|
maintainAspectRatio: false,
|
|
54
54
|
aspectRatio: 1,
|
|
55
|
+
interaction: {
|
|
56
|
+
mode: 'nearest',
|
|
57
|
+
intersect: false
|
|
58
|
+
},
|
|
55
59
|
plugins: {
|
|
56
60
|
padEmptyChartBar: {
|
|
57
61
|
maxBarNumber: customOptions.maxBarNumber
|
|
@@ -71,11 +75,16 @@ const BarChart = _ref => {
|
|
|
71
75
|
return context[0] ? context[0].label.match(/(.{1,20})/g) : '';
|
|
72
76
|
},
|
|
73
77
|
label(context) {
|
|
78
|
+
var _context$dataset$tool;
|
|
79
|
+
const tooltipLabel = (_context$dataset$tool = context.dataset.tooltipLabels) === null || _context$dataset$tool === void 0 ? void 0 : _context$dataset$tool[context.dataIndex];
|
|
80
|
+
if (tooltipLabel !== undefined) {
|
|
81
|
+
return "".concat(context.dataset.label, ": ").concat(tooltipLabel);
|
|
82
|
+
}
|
|
74
83
|
const label = context.dataset.data[context.dataIndex];
|
|
75
84
|
if (context.dataset.customLabel) {
|
|
76
85
|
return context.dataset.customLabel[context.dataIndex].toString();
|
|
77
86
|
}
|
|
78
|
-
return "".concat(label.toString()).concat(customOptions.tooltipLabelPostfix);
|
|
87
|
+
return "".concat(context.dataset.label, ": ").concat(label.toString()).concat(customOptions.tooltipLabelPostfix);
|
|
79
88
|
},
|
|
80
89
|
labelTextColor(context) {
|
|
81
90
|
const {
|