sea-chart 0.0.80 → 0.0.81
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.
|
@@ -81,33 +81,22 @@ async function calculator(chart, value, _ref) {
|
|
|
81
81
|
} else {
|
|
82
82
|
completedRate = (currentValue / targetValue * 100).toFixed(0);
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
});
|
|
101
|
-
} else {
|
|
102
|
-
result.unshift({
|
|
103
|
-
name: label,
|
|
104
|
-
value: currentValue,
|
|
105
|
-
group_name: 'completed',
|
|
106
|
-
current_value: currentValue,
|
|
107
|
-
target_value: targetValue,
|
|
108
|
-
rows
|
|
109
|
-
});
|
|
110
|
-
}
|
|
84
|
+
result.push({
|
|
85
|
+
name: label,
|
|
86
|
+
value: currentValue,
|
|
87
|
+
group_name: 'completed',
|
|
88
|
+
current_value: currentValue,
|
|
89
|
+
target_value: targetValue,
|
|
90
|
+
rows
|
|
91
|
+
}, {
|
|
92
|
+
name: label,
|
|
93
|
+
value: Math.max(targetValue - currentValue, 0),
|
|
94
|
+
group_name: 'rest',
|
|
95
|
+
current_value: currentValue,
|
|
96
|
+
target_value: targetValue,
|
|
97
|
+
rows,
|
|
98
|
+
completedRate
|
|
99
|
+
});
|
|
111
100
|
}
|
|
112
101
|
});
|
|
113
102
|
} else {
|
|
@@ -189,39 +178,26 @@ async function calculator(chart, value, _ref) {
|
|
|
189
178
|
} else {
|
|
190
179
|
completedRate = (currentValue / targetValue * 100).toFixed(0);
|
|
191
180
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
});
|
|
213
|
-
} else {
|
|
214
|
-
result.unshift({
|
|
215
|
-
name: label,
|
|
216
|
-
groupby: groupLabel,
|
|
217
|
-
value: currentValue,
|
|
218
|
-
color,
|
|
219
|
-
group_name: 'completed',
|
|
220
|
-
current_value: currentValue,
|
|
221
|
-
target_value: targetValue,
|
|
222
|
-
rows
|
|
223
|
-
});
|
|
224
|
-
}
|
|
181
|
+
result.push({
|
|
182
|
+
name: label,
|
|
183
|
+
groupby: groupLabel,
|
|
184
|
+
value: currentValue,
|
|
185
|
+
color,
|
|
186
|
+
group_name: 'completed',
|
|
187
|
+
current_value: currentValue,
|
|
188
|
+
target_value: targetValue,
|
|
189
|
+
rows
|
|
190
|
+
}, {
|
|
191
|
+
name: label,
|
|
192
|
+
groupby: groupLabel,
|
|
193
|
+
value: Math.max(targetValue - currentValue, 0),
|
|
194
|
+
color,
|
|
195
|
+
group_name: 'rest',
|
|
196
|
+
current_value: currentValue,
|
|
197
|
+
target_value: targetValue,
|
|
198
|
+
rows,
|
|
199
|
+
completedRate
|
|
200
|
+
});
|
|
225
201
|
}
|
|
226
202
|
});
|
|
227
203
|
result.colorMap = colorMap;
|
|
@@ -3,7 +3,7 @@ import React, { useEffect, useRef } from 'react';
|
|
|
3
3
|
import { maxBy } from 'lodash-es';
|
|
4
4
|
import { BaseUtils, isBoolean } from '../../utils';
|
|
5
5
|
import intl from '../../intl';
|
|
6
|
-
import {
|
|
6
|
+
import { CHART_TYPE, CHART_THEME_COLOR } from '../../constants';
|
|
7
7
|
import ChartComponent from './chart-component';
|
|
8
8
|
export default function Completeness(props) {
|
|
9
9
|
var _chartRef$current, _chartRef$current2;
|
|
@@ -21,11 +21,13 @@ export default function Completeness(props) {
|
|
|
21
21
|
var _style_config$title;
|
|
22
22
|
let {
|
|
23
23
|
chart: {
|
|
24
|
-
style_config
|
|
24
|
+
style_config,
|
|
25
|
+
config
|
|
25
26
|
}
|
|
26
27
|
} = props;
|
|
27
28
|
chartPaddingTop = ((_style_config$title = style_config.title) === null || _style_config$title === void 0 ? void 0 : _style_config$title.text) ? 17 : 0;
|
|
28
|
-
const
|
|
29
|
+
const chartPaddingRight = (config === null || config === void 0 ? void 0 : config.show_percentage) ? 45 : 0;
|
|
30
|
+
const appendPadding = [chartPaddingTop, chartPaddingRight, 0, 0];
|
|
29
31
|
currentChart.initChart(chartContainerRef.current, {
|
|
30
32
|
appendPadding
|
|
31
33
|
});
|