oolib 2.125.1 → 2.125.2
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.
|
@@ -110,10 +110,14 @@ var PercentBarChart = function (_a) {
|
|
|
110
110
|
} },
|
|
111
111
|
react_1.default.createElement(recharts_1.XAxis, { hide: true, type: "number" }),
|
|
112
112
|
react_1.default.createElement(recharts_1.YAxis, { hide: true, type: "category", width: 250, dataKey: labelPath }),
|
|
113
|
-
react_1.default.createElement(recharts_1.Bar, { radius: [2, 4, 4, 2], style: { cursor: "pointer" }, dataKey: "value", unit: "%"
|
|
113
|
+
react_1.default.createElement(recharts_1.Bar, __assign({ radius: [2, 4, 4, 2], style: onClick ? { cursor: "pointer" } : {}, dataKey: "value", unit: "%" }, (onClick ? {
|
|
114
|
+
onMouseOver: function (args) { return setActiveBar(args[labelPath]); },
|
|
115
|
+
onMouseOut: function () { return setActiveBar(undefined); },
|
|
116
|
+
onMouseDown: function (args) {
|
|
114
117
|
setActiveBar(args[labelPath]);
|
|
115
118
|
onClick(args[labelPath]);
|
|
116
|
-
}
|
|
119
|
+
}
|
|
120
|
+
} : {})),
|
|
117
121
|
react_1.default.createElement(recharts_1.LabelList, { dataKey: labelPath, position: "top", content: function (props) {
|
|
118
122
|
return renderCustomizedLabel({
|
|
119
123
|
y: props.y,
|
|
@@ -20,6 +20,6 @@ var PercentBarChart_ = function (args) {
|
|
|
20
20
|
console.log("Bar clicked: ".concat(name));
|
|
21
21
|
};
|
|
22
22
|
return (react_1.default.createElement("div", null,
|
|
23
|
-
react_1.default.createElement(PercentBarChart_1.PercentBarChart, { data: data, labelPath: "name", valuePath: "value", title: "This is PercentBarChart representing the data"
|
|
23
|
+
react_1.default.createElement(PercentBarChart_1.PercentBarChart, { data: data, labelPath: "name", valuePath: "value", title: "This is PercentBarChart representing the data" })));
|
|
24
24
|
};
|
|
25
25
|
exports.PercentBarChart_ = PercentBarChart_;
|