oolib 2.129.2 → 2.129.3
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.
|
@@ -130,22 +130,22 @@ var PercentBarChart = function (_a) {
|
|
|
130
130
|
bottom: 0,
|
|
131
131
|
} },
|
|
132
132
|
react_1.default.createElement(recharts_1.XAxis, { hide: true, type: "number" }),
|
|
133
|
-
react_1.default.createElement(recharts_1.YAxis, { hide: true, type: "category", width: 250, dataKey:
|
|
133
|
+
react_1.default.createElement(recharts_1.YAxis, { hide: true, type: "category", width: 250, dataKey: 'name' }),
|
|
134
134
|
react_1.default.createElement(recharts_1.Bar, __assign({ radius: [2, 4, 4, 2], style: onClick ? { cursor: "pointer" } : {}, dataKey: "percentage" }, (onClick
|
|
135
135
|
? {
|
|
136
|
-
onMouseOver: function (args) { return setActiveBar(args[
|
|
136
|
+
onMouseOver: function (args) { return setActiveBar(args['name']); },
|
|
137
137
|
onMouseOut: function () { return setActiveBar(undefined); },
|
|
138
138
|
onMouseDown: function (args) {
|
|
139
|
-
setActiveBar(args[
|
|
140
|
-
onClick(args[
|
|
139
|
+
setActiveBar(args['name']);
|
|
140
|
+
onClick(args['name']);
|
|
141
141
|
},
|
|
142
142
|
}
|
|
143
143
|
: {})),
|
|
144
|
-
react_1.default.createElement(recharts_1.LabelList, { dataKey:
|
|
144
|
+
react_1.default.createElement(recharts_1.LabelList, { dataKey: 'name', position: "top", content: function (props) {
|
|
145
145
|
return renderCustomizedLabel({
|
|
146
146
|
y: props.y,
|
|
147
147
|
value: props.value,
|
|
148
|
-
opacity: changeBarOpacityFn(props[
|
|
148
|
+
opacity: changeBarOpacityFn(props['name']),
|
|
149
149
|
});
|
|
150
150
|
} }),
|
|
151
151
|
react_1.default.createElement(recharts_1.LabelList, { dataKey: "percentage_count", offset: 0, content: function (props) {
|
|
@@ -157,9 +157,9 @@ var PercentBarChart = function (_a) {
|
|
|
157
157
|
value: props.value, //here value is the percentage
|
|
158
158
|
showCount: showCount,
|
|
159
159
|
suffix: valueSuffix,
|
|
160
|
-
opacity: changeBarOpacityFn(props[
|
|
160
|
+
opacity: changeBarOpacityFn(props['name']),
|
|
161
161
|
});
|
|
162
162
|
} }),
|
|
163
|
-
data.map(function (entry, index) { return (react_1.default.createElement(recharts_1.Cell, { opacity: changeBarOpacityFn(entry[
|
|
163
|
+
data.map(function (entry, index) { return (react_1.default.createElement(recharts_1.Cell, { opacity: changeBarOpacityFn(entry['name']), key: "cell-".concat(index), height: configs.barHeight, fill: entry.color })); })))))));
|
|
164
164
|
};
|
|
165
165
|
exports.PercentBarChart = PercentBarChart;
|
|
@@ -10,16 +10,16 @@ exports.default = {
|
|
|
10
10
|
title: "Components/PercentBarChart",
|
|
11
11
|
};
|
|
12
12
|
var data = [
|
|
13
|
-
{
|
|
14
|
-
{
|
|
15
|
-
{
|
|
16
|
-
{
|
|
13
|
+
{ display: "Great food", value: 72, },
|
|
14
|
+
{ display: "Great Ambience", value: 10, },
|
|
15
|
+
{ display: "Great Music", value: 9, },
|
|
16
|
+
{ display: "Great Cocktails", value: 5, },
|
|
17
17
|
];
|
|
18
18
|
var PercentBarChart_ = function (args) {
|
|
19
19
|
var handleBarClick = function (name) {
|
|
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: "
|
|
23
|
+
react_1.default.createElement(PercentBarChart_1.PercentBarChart, { data: data, labelPath: "display", valuePath: "value", title: "This is PercentBarChart representing the data" })));
|
|
24
24
|
};
|
|
25
25
|
exports.PercentBarChart_ = PercentBarChart_;
|