amazing-react-charts 0.7.1 → 0.7.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.
|
@@ -238,7 +238,7 @@ var ForecastAreaChart = function ForecastAreaChart(props) {
|
|
|
238
238
|
axisLabel: {
|
|
239
239
|
margin: yType === 'time' ? 16 : 14,
|
|
240
240
|
formatter: function formatter(item) {
|
|
241
|
-
return yType === 'time' ? (0, _auxiliarFunctions.timeConvert)(Number(
|
|
241
|
+
return yType === 'time' ? (0, _auxiliarFunctions.timeConvert)(Number(item)) : (0, _auxiliarFunctions.takeLabelComplement)(Number(item.toFixed(2)), yComplement);
|
|
242
242
|
},
|
|
243
243
|
fontSize: fontLabelSize || 11.5
|
|
244
244
|
}
|
|
@@ -209,7 +209,8 @@ var VerticalBarChart = function VerticalBarChart(props) {
|
|
|
209
209
|
|
|
210
210
|
var formatLabel = function formatLabel(chartValues) {
|
|
211
211
|
var value = chartValues.value;
|
|
212
|
-
|
|
212
|
+
var isTimeType = yType === 'time';
|
|
213
|
+
return isTimeType ? (0, _auxiliarFunctions.timeConvert)(Number(value)) + yComplement : (0, _auxiliarFunctions.takeLabelComplement)(Number(value), yComplement);
|
|
213
214
|
};
|
|
214
215
|
|
|
215
216
|
var toolbox = toolboxTooltip && {
|
package/package.json
CHANGED
|
@@ -135,7 +135,7 @@ const ForecastAreaChart = (props: IProps) => {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
const scrollable: ZoomProps[] =
|
|
140
140
|
xData.length > 5
|
|
141
141
|
? [
|
|
@@ -165,7 +165,7 @@ const ForecastAreaChart = (props: IProps) => {
|
|
|
165
165
|
name: forecastChartLegends ? forecastChartLegends.forecast : '',
|
|
166
166
|
data: yData,
|
|
167
167
|
label: {
|
|
168
|
-
formatter:
|
|
168
|
+
formatter:
|
|
169
169
|
typeof yComplement === 'function' ? yComplement : formatLabel,
|
|
170
170
|
show: true,
|
|
171
171
|
position: 'top',
|
|
@@ -216,7 +216,7 @@ const ForecastAreaChart = (props: IProps) => {
|
|
|
216
216
|
name: forecastChartLegends.current || '',
|
|
217
217
|
data: take(lineMarkValue, yData),
|
|
218
218
|
label: {
|
|
219
|
-
formatter:
|
|
219
|
+
formatter:
|
|
220
220
|
typeof yComplement === 'function' ? yComplement : formatLabel,
|
|
221
221
|
show: false,
|
|
222
222
|
position: 'top',
|
|
@@ -268,7 +268,7 @@ const ForecastAreaChart = (props: IProps) => {
|
|
|
268
268
|
margin: yType === 'time' ? 16 : 14,
|
|
269
269
|
formatter: (item: number) =>
|
|
270
270
|
yType === 'time'
|
|
271
|
-
? timeConvert(Number(
|
|
271
|
+
? timeConvert(Number(item))
|
|
272
272
|
: takeLabelComplement(Number(item.toFixed(2)), yComplement),
|
|
273
273
|
fontSize: fontLabelSize || 11.5
|
|
274
274
|
}
|
|
@@ -193,8 +193,11 @@ const VerticalBarChart = (props: IProps) => {
|
|
|
193
193
|
|
|
194
194
|
const formatLabel = (chartValues: DataTooltip) => {
|
|
195
195
|
const { value } = chartValues
|
|
196
|
+
const isTimeType = yType === 'time'
|
|
196
197
|
|
|
197
|
-
return
|
|
198
|
+
return isTimeType
|
|
199
|
+
? timeConvert(Number(value)) + yComplement
|
|
200
|
+
: takeLabelComplement(Number(value), yComplement)
|
|
198
201
|
}
|
|
199
202
|
|
|
200
203
|
const toolbox = toolboxTooltip && {
|
|
@@ -3,208 +3,240 @@ name: Vertical bar charts
|
|
|
3
3
|
route: /vertical-bar-chart
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import VerticalBarChart from
|
|
7
|
-
import { Playground } from
|
|
6
|
+
import VerticalBarChart from "../core/VerticalBarChart";
|
|
7
|
+
import { Playground } from "docz";
|
|
8
8
|
|
|
9
9
|
# Vertical bar chart example
|
|
10
|
+
|
|
10
11
|
<Playground>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
12
|
+
<VerticalBarChart
|
|
13
|
+
showBarLabel
|
|
14
|
+
yComplement="%"
|
|
15
|
+
xType="category"
|
|
16
|
+
yType="value"
|
|
17
|
+
color="green"
|
|
18
|
+
title="Bar Chart example"
|
|
19
|
+
toolboxTooltip={{ saveAsImage: "save" }}
|
|
20
|
+
tooltip={{ label: "Equipamento", result: "Disponibilidade" }}
|
|
21
|
+
data={[
|
|
22
|
+
{
|
|
23
|
+
label: "NG209131231",
|
|
24
|
+
result: "100",
|
|
25
|
+
itemId: 1,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: "NG21021313",
|
|
29
|
+
result: "10",
|
|
30
|
+
itemId: 1,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "NG211131231",
|
|
34
|
+
result: "100",
|
|
35
|
+
itemId: 1,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: "NG21221312313",
|
|
39
|
+
result: "100",
|
|
40
|
+
itemId: 1,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: "NG213133123",
|
|
44
|
+
result: "100",
|
|
45
|
+
itemId: 1,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: "NG2142232313",
|
|
49
|
+
result: "100",
|
|
50
|
+
itemId: 1,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "NG2151111",
|
|
54
|
+
result: "10",
|
|
55
|
+
itemId: 1,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "NG216444533",
|
|
59
|
+
result: "100",
|
|
60
|
+
itemId: 1,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: "NG2172222",
|
|
64
|
+
result: "100",
|
|
65
|
+
itemId: 1,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: "NG21822222",
|
|
69
|
+
result: "100",
|
|
70
|
+
itemId: 1,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: "NG2192222222222",
|
|
74
|
+
result: "10",
|
|
75
|
+
itemId: 1,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: "NG22022222222222",
|
|
79
|
+
result: "100",
|
|
80
|
+
itemId: 1,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: "NG22122222222",
|
|
84
|
+
result: "100",
|
|
85
|
+
itemId: 1,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: "NG2222222222222",
|
|
89
|
+
result: "100",
|
|
90
|
+
itemId: 1,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: "31",
|
|
94
|
+
result: "100",
|
|
95
|
+
itemId: 1,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: "3",
|
|
99
|
+
result: "10",
|
|
100
|
+
itemId: 1,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: "31",
|
|
104
|
+
result: "100",
|
|
105
|
+
itemId: 1,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label: "2313",
|
|
109
|
+
result: "100",
|
|
110
|
+
itemId: 1,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: "23",
|
|
114
|
+
result: "100",
|
|
115
|
+
itemId: 1,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: "313",
|
|
119
|
+
result: "100",
|
|
120
|
+
itemId: 1,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: "45",
|
|
124
|
+
result: "10",
|
|
125
|
+
itemId: 1,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
label: "33",
|
|
129
|
+
result: "100",
|
|
130
|
+
itemId: 1,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: "89",
|
|
134
|
+
result: "100",
|
|
135
|
+
itemId: 1,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
label: "299",
|
|
139
|
+
result: "100",
|
|
140
|
+
itemId: 1,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
label: "222222",
|
|
144
|
+
result: "10",
|
|
145
|
+
itemId: 1,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
label: "222484842222",
|
|
149
|
+
result: "100",
|
|
150
|
+
itemId: 1,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
label: "2222",
|
|
154
|
+
result: "100",
|
|
155
|
+
itemId: 1,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
label: "22222552",
|
|
159
|
+
result: "100",
|
|
160
|
+
itemId: 1,
|
|
161
|
+
},
|
|
162
|
+
]}
|
|
162
163
|
/>
|
|
163
164
|
</Playground>
|
|
164
165
|
|
|
165
|
-
|
|
166
166
|
# Vertical bar chart example with customMaxDomain
|
|
167
|
+
|
|
167
168
|
<Playground>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
169
|
+
<VerticalBarChart
|
|
170
|
+
showBarLabel
|
|
171
|
+
yComplement={(value) => `R$ ${value},00`}
|
|
172
|
+
xType="category"
|
|
173
|
+
yType="value"
|
|
174
|
+
color="blue"
|
|
175
|
+
title="Bar Chart example"
|
|
176
|
+
customMaxDomain={3000}
|
|
177
|
+
toolboxTooltip={{ saveAsImage: "save" }}
|
|
178
|
+
tooltip={{ label: "Equipamento", result: "Disponibilidade" }}
|
|
179
|
+
data={[
|
|
180
|
+
{
|
|
181
|
+
label: "NG209131231",
|
|
182
|
+
result: "2057",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
label: "NG21021313",
|
|
186
|
+
result: "20",
|
|
187
|
+
},
|
|
188
|
+
]}
|
|
188
189
|
/>
|
|
189
190
|
</Playground>
|
|
190
191
|
|
|
191
192
|
# Vertical bar chart with dateFormat
|
|
193
|
+
|
|
194
|
+
<Playground>
|
|
195
|
+
<VerticalBarChart
|
|
196
|
+
showBarLabel
|
|
197
|
+
title="Bar Chart example"
|
|
198
|
+
xType="time"
|
|
199
|
+
yComplement="%"
|
|
200
|
+
dateFormat="yyyy-MM"
|
|
201
|
+
color="blue"
|
|
202
|
+
customMaxDomain={100}
|
|
203
|
+
toolboxTooltip={{ saveAsImage: "save as image" }}
|
|
204
|
+
tooltip={{ label: "Date", result: "Disp" }}
|
|
205
|
+
data={[
|
|
206
|
+
{
|
|
207
|
+
label: "2020-01",
|
|
208
|
+
result: "50",
|
|
209
|
+
},
|
|
210
|
+
]}
|
|
211
|
+
/>
|
|
212
|
+
</Playground>
|
|
213
|
+
|
|
214
|
+
# Vertical bar chart with time format
|
|
215
|
+
|
|
192
216
|
<Playground>
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
217
|
+
<VerticalBarChart
|
|
218
|
+
showBarLabel
|
|
219
|
+
title="Bar Chart with hours"
|
|
220
|
+
xType="category"
|
|
221
|
+
yType="time"
|
|
222
|
+
yComplement="h"
|
|
223
|
+
color="orange"
|
|
224
|
+
customMaxDomain={240}
|
|
225
|
+
toolboxTooltip={{ saveAsImage: "save as image" }}
|
|
226
|
+
tooltip={{ label: "Grupo", result: "MTTR" }}
|
|
227
|
+
data={[
|
|
228
|
+
{
|
|
229
|
+
label: "A",
|
|
230
|
+
result: "238.62",
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
label: "B",
|
|
234
|
+
result: "28.80",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: "C",
|
|
238
|
+
result: "62.30",
|
|
239
|
+
},
|
|
240
|
+
]}
|
|
241
|
+
/>
|
|
210
242
|
</Playground>
|