@mui/x-charts 6.19.3 → 6.19.4
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/BarChart/BarChart.js +11 -9
- package/BarChart/BarElement.d.ts +6 -3
- package/BarChart/BarElement.js +1 -0
- package/BarChart/BarPlot.js +9 -10
- package/CHANGELOG.md +56 -0
- package/ChartsAxis/ChartsAxis.js +4 -4
- package/ChartsLegend/ChartsLegend.js +0 -101
- package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/ChartsReferenceLine/common.d.ts +2 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +4 -4
- package/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -2
- package/ChartsXAxis/ChartsXAxis.js +13 -9
- package/ChartsYAxis/ChartsYAxis.js +1 -1
- package/LineChart/AreaElement.d.ts +7 -4
- package/LineChart/AreaElement.js +1 -0
- package/LineChart/LineChart.js +11 -9
- package/LineChart/LineElement.d.ts +7 -4
- package/LineChart/LineElement.js +1 -0
- package/LineChart/LineHighlightElement.d.ts +3 -2
- package/LineChart/LineHighlightElement.js +2 -1
- package/LineChart/MarkElement.d.ts +3 -2
- package/LineChart/MarkElement.js +1 -0
- package/PieChart/PieArc.d.ts +3 -2
- package/PieChart/PieArc.js +1 -0
- package/PieChart/PieArcLabel.d.ts +3 -2
- package/PieChart/PieArcLabel.js +1 -0
- package/PieChart/PieArcLabelPlot.js +1 -1
- package/PieChart/PieArcPlot.js +1 -1
- package/PieChart/PieChart.js +11 -9
- package/ScatterChart/Scatter.js +1 -1
- package/ScatterChart/ScatterChart.js +11 -9
- package/SparkLineChart/SparkLineChart.js +3 -2
- package/context/CartesianContextProvider.js +8 -6
- package/context/InteractionProvider.d.ts +2 -2
- package/esm/BarChart/BarChart.js +11 -9
- package/esm/BarChart/BarElement.js +1 -0
- package/esm/BarChart/BarPlot.js +8 -10
- package/esm/ChartsAxis/ChartsAxis.js +4 -4
- package/esm/ChartsLegend/ChartsLegend.js +0 -101
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +4 -4
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -2
- package/esm/ChartsXAxis/ChartsXAxis.js +13 -9
- package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
- package/esm/LineChart/AreaElement.js +1 -0
- package/esm/LineChart/LineChart.js +11 -9
- package/esm/LineChart/LineElement.js +1 -0
- package/esm/LineChart/LineHighlightElement.js +2 -1
- package/esm/LineChart/MarkElement.js +1 -0
- package/esm/PieChart/PieArc.js +1 -0
- package/esm/PieChart/PieArcLabel.js +1 -0
- package/esm/PieChart/PieArcLabelPlot.js +1 -1
- package/esm/PieChart/PieArcPlot.js +1 -1
- package/esm/PieChart/PieChart.js +11 -9
- package/esm/ScatterChart/Scatter.js +1 -1
- package/esm/ScatterChart/ScatterChart.js +11 -9
- package/esm/SparkLineChart/SparkLineChart.js +3 -2
- package/esm/context/CartesianContextProvider.js +8 -6
- package/index.js +1 -1
- package/internals/defaultizeColor.d.ts +15 -15
- package/internals/defaultizeValueFormatter.d.ts +4 -7
- package/internals/stackSeries.d.ts +4 -7
- package/legacy/BarChart/BarChart.js +11 -9
- package/legacy/BarChart/BarElement.js +1 -0
- package/legacy/BarChart/BarPlot.js +10 -10
- package/legacy/ChartsAxis/ChartsAxis.js +4 -4
- package/legacy/ChartsLegend/ChartsLegend.js +0 -101
- package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +4 -4
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -2
- package/legacy/ChartsXAxis/ChartsXAxis.js +12 -8
- package/legacy/ChartsYAxis/ChartsYAxis.js +1 -1
- package/legacy/LineChart/AreaElement.js +1 -0
- package/legacy/LineChart/LineChart.js +11 -9
- package/legacy/LineChart/LineElement.js +1 -0
- package/legacy/LineChart/LineHighlightElement.js +2 -1
- package/legacy/LineChart/MarkElement.js +1 -0
- package/legacy/PieChart/PieArc.js +1 -0
- package/legacy/PieChart/PieArcLabel.js +1 -0
- package/legacy/PieChart/PieArcLabelPlot.js +1 -1
- package/legacy/PieChart/PieArcPlot.js +1 -1
- package/legacy/PieChart/PieChart.js +11 -9
- package/legacy/ScatterChart/Scatter.js +1 -1
- package/legacy/ScatterChart/ScatterChart.js +11 -9
- package/legacy/SparkLineChart/SparkLineChart.js +3 -2
- package/legacy/context/CartesianContextProvider.js +8 -6
- package/legacy/index.js +1 -1
- package/models/axis.d.ts +7 -2
- package/models/seriesType/common.d.ts +2 -1
- package/models/seriesType/config.d.ts +7 -12
- package/models/seriesType/line.d.ts +2 -2
- package/models/seriesType/pie.d.ts +7 -3
- package/models/seriesType/scatter.d.ts +5 -2
- package/modern/BarChart/BarChart.js +11 -9
- package/modern/BarChart/BarElement.js +1 -0
- package/modern/BarChart/BarPlot.js +8 -10
- package/modern/ChartsAxis/ChartsAxis.js +4 -4
- package/modern/ChartsLegend/ChartsLegend.js +0 -101
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +4 -4
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -2
- package/modern/ChartsXAxis/ChartsXAxis.js +13 -9
- package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
- package/modern/LineChart/AreaElement.js +1 -0
- package/modern/LineChart/LineChart.js +11 -9
- package/modern/LineChart/LineElement.js +1 -0
- package/modern/LineChart/LineHighlightElement.js +2 -1
- package/modern/LineChart/MarkElement.js +1 -0
- package/modern/PieChart/PieArc.js +1 -0
- package/modern/PieChart/PieArcLabel.js +1 -0
- package/modern/PieChart/PieArcLabelPlot.js +1 -1
- package/modern/PieChart/PieArcPlot.js +1 -1
- package/modern/PieChart/PieChart.js +11 -9
- package/modern/ScatterChart/Scatter.js +1 -1
- package/modern/ScatterChart/ScatterChart.js +11 -9
- package/modern/SparkLineChart/SparkLineChart.js +3 -2
- package/modern/context/CartesianContextProvider.js +8 -6
- package/modern/index.js +1 -1
- package/package.json +1 -1
package/esm/PieChart/PieChart.js
CHANGED
|
@@ -111,7 +111,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
111
111
|
* @default null
|
|
112
112
|
*/
|
|
113
113
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
114
|
-
axisId: PropTypes.string,
|
|
114
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
115
115
|
classes: PropTypes.object,
|
|
116
116
|
disableLine: PropTypes.bool,
|
|
117
117
|
disableTicks: PropTypes.bool,
|
|
@@ -161,7 +161,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
161
161
|
* @default null
|
|
162
162
|
*/
|
|
163
163
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
164
|
-
axisId: PropTypes.string,
|
|
164
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
165
165
|
classes: PropTypes.object,
|
|
166
166
|
disableLine: PropTypes.bool,
|
|
167
167
|
disableTicks: PropTypes.bool,
|
|
@@ -215,7 +215,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
215
215
|
* @default null
|
|
216
216
|
*/
|
|
217
217
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
218
|
-
axisId: PropTypes.string,
|
|
218
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
219
219
|
classes: PropTypes.object,
|
|
220
220
|
disableLine: PropTypes.bool,
|
|
221
221
|
disableTicks: PropTypes.bool,
|
|
@@ -273,7 +273,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
273
273
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
274
274
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
275
275
|
}),
|
|
276
|
-
id: PropTypes.string,
|
|
276
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
277
277
|
innerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
278
278
|
outerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
279
279
|
paddingAngle: PropTypes.number,
|
|
@@ -309,7 +309,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
309
309
|
* @default null
|
|
310
310
|
*/
|
|
311
311
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
312
|
-
axisId: PropTypes.string,
|
|
312
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
313
313
|
classes: PropTypes.object,
|
|
314
314
|
disableLine: PropTypes.bool,
|
|
315
315
|
disableTicks: PropTypes.bool,
|
|
@@ -346,7 +346,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
346
346
|
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
347
347
|
*/
|
|
348
348
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
349
|
-
axisId: PropTypes.string,
|
|
349
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
350
350
|
classes: PropTypes.object,
|
|
351
351
|
data: PropTypes.array,
|
|
352
352
|
dataKey: PropTypes.string,
|
|
@@ -354,13 +354,14 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
354
354
|
disableTicks: PropTypes.bool,
|
|
355
355
|
fill: PropTypes.string,
|
|
356
356
|
hideTooltip: PropTypes.bool,
|
|
357
|
-
id: PropTypes.string,
|
|
357
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
358
358
|
label: PropTypes.string,
|
|
359
359
|
labelFontSize: PropTypes.number,
|
|
360
360
|
labelStyle: PropTypes.object,
|
|
361
361
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
362
362
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
363
363
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
364
|
+
reverse: PropTypes.bool,
|
|
364
365
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
365
366
|
slotProps: PropTypes.object,
|
|
366
367
|
slots: PropTypes.object,
|
|
@@ -380,7 +381,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
380
381
|
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
381
382
|
*/
|
|
382
383
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
383
|
-
axisId: PropTypes.string,
|
|
384
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
384
385
|
classes: PropTypes.object,
|
|
385
386
|
data: PropTypes.array,
|
|
386
387
|
dataKey: PropTypes.string,
|
|
@@ -388,13 +389,14 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
388
389
|
disableTicks: PropTypes.bool,
|
|
389
390
|
fill: PropTypes.string,
|
|
390
391
|
hideTooltip: PropTypes.bool,
|
|
391
|
-
id: PropTypes.string,
|
|
392
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
392
393
|
label: PropTypes.string,
|
|
393
394
|
labelFontSize: PropTypes.number,
|
|
394
395
|
labelStyle: PropTypes.object,
|
|
395
396
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
396
397
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
397
398
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
399
|
+
reverse: PropTypes.bool,
|
|
398
400
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
399
401
|
slotProps: PropTypes.object,
|
|
400
402
|
slots: PropTypes.object,
|
|
@@ -88,7 +88,7 @@ process.env.NODE_ENV !== "production" ? Scatter.propTypes = {
|
|
|
88
88
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
89
89
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
90
90
|
}),
|
|
91
|
-
id: PropTypes.string.isRequired,
|
|
91
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
92
92
|
label: PropTypes.string,
|
|
93
93
|
markerSize: PropTypes.number,
|
|
94
94
|
type: PropTypes.oneOf(['scatter']).isRequired,
|
|
@@ -88,7 +88,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
88
88
|
* @default xAxisIds[0] The id of the first provided axis
|
|
89
89
|
*/
|
|
90
90
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
91
|
-
axisId: PropTypes.string,
|
|
91
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
92
92
|
classes: PropTypes.object,
|
|
93
93
|
disableLine: PropTypes.bool,
|
|
94
94
|
disableTicks: PropTypes.bool,
|
|
@@ -138,7 +138,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
138
138
|
* @default yAxisIds[0] The id of the first provided axis
|
|
139
139
|
*/
|
|
140
140
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
141
|
-
axisId: PropTypes.string,
|
|
141
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
142
142
|
classes: PropTypes.object,
|
|
143
143
|
disableLine: PropTypes.bool,
|
|
144
144
|
disableTicks: PropTypes.bool,
|
|
@@ -191,7 +191,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
191
191
|
* @default null
|
|
192
192
|
*/
|
|
193
193
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
194
|
-
axisId: PropTypes.string,
|
|
194
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
195
195
|
classes: PropTypes.object,
|
|
196
196
|
disableLine: PropTypes.bool,
|
|
197
197
|
disableTicks: PropTypes.bool,
|
|
@@ -223,7 +223,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
223
223
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
224
224
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
225
225
|
}),
|
|
226
|
-
id: PropTypes.string,
|
|
226
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
227
227
|
label: PropTypes.string,
|
|
228
228
|
markerSize: PropTypes.number,
|
|
229
229
|
type: PropTypes.oneOf(['scatter']),
|
|
@@ -257,7 +257,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
257
257
|
* @default null
|
|
258
258
|
*/
|
|
259
259
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
260
|
-
axisId: PropTypes.string,
|
|
260
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
261
261
|
classes: PropTypes.object,
|
|
262
262
|
disableLine: PropTypes.bool,
|
|
263
263
|
disableTicks: PropTypes.bool,
|
|
@@ -294,7 +294,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
294
294
|
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
295
295
|
*/
|
|
296
296
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
297
|
-
axisId: PropTypes.string,
|
|
297
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
298
298
|
classes: PropTypes.object,
|
|
299
299
|
data: PropTypes.array,
|
|
300
300
|
dataKey: PropTypes.string,
|
|
@@ -302,13 +302,14 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
302
302
|
disableTicks: PropTypes.bool,
|
|
303
303
|
fill: PropTypes.string,
|
|
304
304
|
hideTooltip: PropTypes.bool,
|
|
305
|
-
id: PropTypes.string,
|
|
305
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
306
306
|
label: PropTypes.string,
|
|
307
307
|
labelFontSize: PropTypes.number,
|
|
308
308
|
labelStyle: PropTypes.object,
|
|
309
309
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
310
310
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
311
311
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
312
|
+
reverse: PropTypes.bool,
|
|
312
313
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
313
314
|
slotProps: PropTypes.object,
|
|
314
315
|
slots: PropTypes.object,
|
|
@@ -328,7 +329,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
328
329
|
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
329
330
|
*/
|
|
330
331
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
331
|
-
axisId: PropTypes.string,
|
|
332
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
332
333
|
classes: PropTypes.object,
|
|
333
334
|
data: PropTypes.array,
|
|
334
335
|
dataKey: PropTypes.string,
|
|
@@ -336,13 +337,14 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
336
337
|
disableTicks: PropTypes.bool,
|
|
337
338
|
fill: PropTypes.string,
|
|
338
339
|
hideTooltip: PropTypes.bool,
|
|
339
|
-
id: PropTypes.string,
|
|
340
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
340
341
|
label: PropTypes.string,
|
|
341
342
|
labelFontSize: PropTypes.number,
|
|
342
343
|
labelStyle: PropTypes.object,
|
|
343
344
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
344
345
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
345
346
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
347
|
+
reverse: PropTypes.bool,
|
|
346
348
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
347
349
|
slotProps: PropTypes.object,
|
|
348
350
|
slots: PropTypes.object,
|
|
@@ -223,7 +223,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
223
223
|
* Notice it is a single configuration object, not an array of configuration.
|
|
224
224
|
*/
|
|
225
225
|
xAxis: PropTypes.shape({
|
|
226
|
-
axisId: PropTypes.string,
|
|
226
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
227
227
|
classes: PropTypes.object,
|
|
228
228
|
data: PropTypes.array,
|
|
229
229
|
dataKey: PropTypes.string,
|
|
@@ -231,13 +231,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
231
231
|
disableTicks: PropTypes.bool,
|
|
232
232
|
fill: PropTypes.string,
|
|
233
233
|
hideTooltip: PropTypes.bool,
|
|
234
|
-
id: PropTypes.string,
|
|
234
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
235
235
|
label: PropTypes.string,
|
|
236
236
|
labelFontSize: PropTypes.number,
|
|
237
237
|
labelStyle: PropTypes.object,
|
|
238
238
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
239
239
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
240
240
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
241
|
+
reverse: PropTypes.bool,
|
|
241
242
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
242
243
|
slotProps: PropTypes.object,
|
|
243
244
|
slots: PropTypes.object,
|
|
@@ -110,7 +110,7 @@ function CartesianContextProvider(props) {
|
|
|
110
110
|
var _axis$scaleType, _axis$min, _axis$max, _axis$min2, _axis$max2;
|
|
111
111
|
const isDefaultAxis = axisIndex === 0;
|
|
112
112
|
const [minData, maxData] = getAxisExtremum(axis, xExtremumGetters, isDefaultAxis);
|
|
113
|
-
const range = [drawingArea.left, drawingArea.left + drawingArea.width];
|
|
113
|
+
const range = axis.reverse ? [drawingArea.left + drawingArea.width, drawingArea.left] : [drawingArea.left, drawingArea.left + drawingArea.width];
|
|
114
114
|
if (isBandScaleConfig(axis)) {
|
|
115
115
|
var _axis$categoryGapRati, _axis$barGapRatio;
|
|
116
116
|
const categoryGapRatio = (_axis$categoryGapRati = axis.categoryGapRatio) != null ? _axis$categoryGapRati : DEFAULT_CATEGORY_GAP_RATIO;
|
|
@@ -161,7 +161,7 @@ function CartesianContextProvider(props) {
|
|
|
161
161
|
var _axis$scaleType2, _axis$min3, _axis$max3, _axis$min4, _axis$max4;
|
|
162
162
|
const isDefaultAxis = axisIndex === 0;
|
|
163
163
|
const [minData, maxData] = getAxisExtremum(axis, yExtremumGetters, isDefaultAxis);
|
|
164
|
-
const range = [drawingArea.top + drawingArea.height, drawingArea.top];
|
|
164
|
+
const range = axis.reverse ? [drawingArea.top, drawingArea.top + drawingArea.height] : [drawingArea.top + drawingArea.height, drawingArea.top];
|
|
165
165
|
if (isBandScaleConfig(axis)) {
|
|
166
166
|
var _axis$categoryGapRati2;
|
|
167
167
|
const categoryGapRatio = (_axis$categoryGapRati2 = axis.categoryGapRatio) != null ? _axis$categoryGapRati2 : DEFAULT_CATEGORY_GAP_RATIO;
|
|
@@ -231,7 +231,7 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
|
|
|
231
231
|
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
232
232
|
*/
|
|
233
233
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
234
|
-
axisId: PropTypes.string,
|
|
234
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
235
235
|
classes: PropTypes.object,
|
|
236
236
|
data: PropTypes.array,
|
|
237
237
|
dataKey: PropTypes.string,
|
|
@@ -239,13 +239,14 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
|
|
|
239
239
|
disableTicks: PropTypes.bool,
|
|
240
240
|
fill: PropTypes.string,
|
|
241
241
|
hideTooltip: PropTypes.bool,
|
|
242
|
-
id: PropTypes.string,
|
|
242
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
243
243
|
label: PropTypes.string,
|
|
244
244
|
labelFontSize: PropTypes.number,
|
|
245
245
|
labelStyle: PropTypes.object,
|
|
246
246
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
247
247
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
248
248
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
249
|
+
reverse: PropTypes.bool,
|
|
249
250
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
250
251
|
slotProps: PropTypes.object,
|
|
251
252
|
slots: PropTypes.object,
|
|
@@ -265,7 +266,7 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
|
|
|
265
266
|
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
266
267
|
*/
|
|
267
268
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
268
|
-
axisId: PropTypes.string,
|
|
269
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
269
270
|
classes: PropTypes.object,
|
|
270
271
|
data: PropTypes.array,
|
|
271
272
|
dataKey: PropTypes.string,
|
|
@@ -273,13 +274,14 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
|
|
|
273
274
|
disableTicks: PropTypes.bool,
|
|
274
275
|
fill: PropTypes.string,
|
|
275
276
|
hideTooltip: PropTypes.bool,
|
|
276
|
-
id: PropTypes.string,
|
|
277
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
277
278
|
label: PropTypes.string,
|
|
278
279
|
labelFontSize: PropTypes.number,
|
|
279
280
|
labelStyle: PropTypes.object,
|
|
280
281
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
281
282
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
282
283
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
284
|
+
reverse: PropTypes.bool,
|
|
283
285
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
284
286
|
slotProps: PropTypes.object,
|
|
285
287
|
slots: PropTypes.object,
|
package/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
4
4
|
color: string;
|
|
5
5
|
label?: string | undefined;
|
|
6
6
|
value: number;
|
|
7
|
-
id?:
|
|
7
|
+
id?: import("../models/seriesType").PieItemId | undefined;
|
|
8
8
|
}[];
|
|
9
9
|
type: "pie";
|
|
10
10
|
innerRadius?: string | number | undefined;
|
|
@@ -37,7 +37,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
37
37
|
arcLabelRadius?: number | undefined;
|
|
38
38
|
color?: string | undefined;
|
|
39
39
|
} | undefined;
|
|
40
|
-
id?:
|
|
40
|
+
id?: import("../models/seriesType/common").SeriesId | undefined;
|
|
41
41
|
color?: string | undefined;
|
|
42
42
|
valueFormatter?: ((value: import("../models/helpers").MakeOptional<import("../models/seriesType").PieValueType, "id">) => string) | undefined;
|
|
43
43
|
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
@@ -48,7 +48,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
48
48
|
label?: string | undefined;
|
|
49
49
|
layout?: "horizontal" | "vertical" | undefined;
|
|
50
50
|
stackOffset?: import("..").StackOffsetType | undefined;
|
|
51
|
-
id?:
|
|
51
|
+
id?: import("../models/seriesType/common").SeriesId | undefined;
|
|
52
52
|
color: string;
|
|
53
53
|
valueFormatter?: ((value: number) => string) | undefined;
|
|
54
54
|
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
@@ -56,6 +56,17 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
56
56
|
yAxisKey?: string | undefined;
|
|
57
57
|
stack?: string | undefined;
|
|
58
58
|
stackOrder?: import("..").StackOrderType | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
type: "scatter";
|
|
61
|
+
data: import("../models/seriesType").ScatterValueType[];
|
|
62
|
+
markerSize?: number | undefined;
|
|
63
|
+
label?: string | undefined;
|
|
64
|
+
id?: import("../models/seriesType/common").SeriesId | undefined;
|
|
65
|
+
color: string;
|
|
66
|
+
valueFormatter?: ((value: import("../models/seriesType").ScatterValueType) => string) | undefined;
|
|
67
|
+
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
68
|
+
xAxisKey?: string | undefined;
|
|
69
|
+
yAxisKey?: string | undefined;
|
|
59
70
|
} | {
|
|
60
71
|
type: "line";
|
|
61
72
|
data?: (number | null)[] | undefined;
|
|
@@ -68,22 +79,11 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
68
79
|
disableHighlight?: boolean | undefined;
|
|
69
80
|
connectNulls?: boolean | undefined;
|
|
70
81
|
stackOffset?: import("..").StackOffsetType | undefined;
|
|
71
|
-
id?:
|
|
82
|
+
id?: import("../models/seriesType/common").SeriesId | undefined;
|
|
72
83
|
color: string;
|
|
73
84
|
valueFormatter?: ((value: number) => string) | undefined;
|
|
74
85
|
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
75
86
|
xAxisKey?: string | undefined;
|
|
76
87
|
yAxisKey?: string | undefined;
|
|
77
88
|
stackOrder?: import("..").StackOrderType | undefined;
|
|
78
|
-
} | {
|
|
79
|
-
type: "scatter";
|
|
80
|
-
data: import("../models/seriesType").ScatterValueType[];
|
|
81
|
-
markerSize?: number | undefined;
|
|
82
|
-
label?: string | undefined;
|
|
83
|
-
id?: string | undefined;
|
|
84
|
-
color: string;
|
|
85
|
-
valueFormatter?: ((value: import("../models/seriesType").ScatterValueType) => string) | undefined;
|
|
86
|
-
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
87
|
-
xAxisKey?: string | undefined;
|
|
88
|
-
yAxisKey?: string | undefined;
|
|
89
89
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import { SeriesId } from '../models/seriesType/common';
|
|
1
2
|
declare function defaultizeValueFormatter<ISeries extends {
|
|
2
3
|
valueFormatter?: IFormatter;
|
|
3
|
-
}, IFormatter extends (v: any) => string>(series: {
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
[id: string]: ISeries & {
|
|
7
|
-
valueFormatter: IFormatter;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
4
|
+
}, IFormatter extends (v: any) => string>(series: Record<SeriesId, ISeries>, defaultValueFormatter: IFormatter): Record<SeriesId, ISeries & {
|
|
5
|
+
valueFormatter: IFormatter;
|
|
6
|
+
}>;
|
|
10
7
|
export default defaultizeValueFormatter;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import { Series } from 'd3-shape';
|
|
2
2
|
import type { BarSeriesType, LineSeriesType } from '../models/seriesType';
|
|
3
3
|
import type { StackOffsetType, StackOrderType } from '../models/stacking';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} | {
|
|
7
|
-
[id: string]: LineSeriesType;
|
|
8
|
-
};
|
|
4
|
+
import { SeriesId } from '../models/seriesType/common';
|
|
5
|
+
type StackableSeries = Record<SeriesId, BarSeriesType> | Record<SeriesId, LineSeriesType>;
|
|
9
6
|
type FormatterParams = {
|
|
10
7
|
series: StackableSeries;
|
|
11
|
-
seriesOrder:
|
|
8
|
+
seriesOrder: SeriesId[];
|
|
12
9
|
defaultStrategy?: {
|
|
13
10
|
stackOrder?: StackOrderType;
|
|
14
11
|
stackOffset?: StackOffsetType;
|
|
15
12
|
};
|
|
16
13
|
};
|
|
17
14
|
export type StackingGroupsType = {
|
|
18
|
-
ids:
|
|
15
|
+
ids: SeriesId[];
|
|
19
16
|
stackingOrder: (series: Series<any, any>) => number[];
|
|
20
17
|
stackingOffset: (series: Series<any, any>, order: Iterable<number>) => void;
|
|
21
18
|
}[];
|
|
@@ -136,7 +136,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
136
136
|
* @default xAxisIds[0] The id of the first provided axis
|
|
137
137
|
*/
|
|
138
138
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
139
|
-
axisId: PropTypes.string,
|
|
139
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
140
140
|
classes: PropTypes.object,
|
|
141
141
|
disableLine: PropTypes.bool,
|
|
142
142
|
disableTicks: PropTypes.bool,
|
|
@@ -187,7 +187,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
187
187
|
* @default yAxisIds[0] The id of the first provided axis
|
|
188
188
|
*/
|
|
189
189
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
190
|
-
axisId: PropTypes.string,
|
|
190
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
191
191
|
classes: PropTypes.object,
|
|
192
192
|
disableLine: PropTypes.bool,
|
|
193
193
|
disableTicks: PropTypes.bool,
|
|
@@ -240,7 +240,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
240
240
|
* @default null
|
|
241
241
|
*/
|
|
242
242
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
243
|
-
axisId: PropTypes.string,
|
|
243
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
244
244
|
classes: PropTypes.object,
|
|
245
245
|
disableLine: PropTypes.bool,
|
|
246
246
|
disableTicks: PropTypes.bool,
|
|
@@ -269,7 +269,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
269
269
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
270
270
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
271
271
|
}),
|
|
272
|
-
id: PropTypes.string,
|
|
272
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
273
273
|
label: PropTypes.string,
|
|
274
274
|
layout: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
275
275
|
stack: PropTypes.string,
|
|
@@ -311,7 +311,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
311
311
|
* @default null
|
|
312
312
|
*/
|
|
313
313
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
314
|
-
axisId: PropTypes.string,
|
|
314
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
315
315
|
classes: PropTypes.object,
|
|
316
316
|
disableLine: PropTypes.bool,
|
|
317
317
|
disableTicks: PropTypes.bool,
|
|
@@ -348,7 +348,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
348
348
|
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
349
349
|
*/
|
|
350
350
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
351
|
-
axisId: PropTypes.string,
|
|
351
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
352
352
|
classes: PropTypes.object,
|
|
353
353
|
data: PropTypes.array,
|
|
354
354
|
dataKey: PropTypes.string,
|
|
@@ -356,13 +356,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
356
356
|
disableTicks: PropTypes.bool,
|
|
357
357
|
fill: PropTypes.string,
|
|
358
358
|
hideTooltip: PropTypes.bool,
|
|
359
|
-
id: PropTypes.string,
|
|
359
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
360
360
|
label: PropTypes.string,
|
|
361
361
|
labelFontSize: PropTypes.number,
|
|
362
362
|
labelStyle: PropTypes.object,
|
|
363
363
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
364
364
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
365
365
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
366
|
+
reverse: PropTypes.bool,
|
|
366
367
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
367
368
|
slotProps: PropTypes.object,
|
|
368
369
|
slots: PropTypes.object,
|
|
@@ -382,7 +383,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
382
383
|
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
383
384
|
*/
|
|
384
385
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
385
|
-
axisId: PropTypes.string,
|
|
386
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
386
387
|
classes: PropTypes.object,
|
|
387
388
|
data: PropTypes.array,
|
|
388
389
|
dataKey: PropTypes.string,
|
|
@@ -390,13 +391,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
390
391
|
disableTicks: PropTypes.bool,
|
|
391
392
|
fill: PropTypes.string,
|
|
392
393
|
hideTooltip: PropTypes.bool,
|
|
393
|
-
id: PropTypes.string,
|
|
394
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
394
395
|
label: PropTypes.string,
|
|
395
396
|
labelFontSize: PropTypes.number,
|
|
396
397
|
labelStyle: PropTypes.object,
|
|
397
398
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
398
399
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
399
400
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
401
|
+
reverse: PropTypes.bool,
|
|
400
402
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
401
403
|
slotProps: PropTypes.object,
|
|
402
404
|
slots: PropTypes.object,
|
|
@@ -101,6 +101,7 @@ process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
|
|
|
101
101
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
102
102
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
103
103
|
}),
|
|
104
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
104
105
|
/**
|
|
105
106
|
* The props used for each component slot.
|
|
106
107
|
* @default {}
|
|
@@ -10,7 +10,7 @@ import { CartesianContext } from '../context/CartesianContextProvider';
|
|
|
10
10
|
import { BarElement } from './BarElement';
|
|
11
11
|
import { isBandScaleConfig } from '../models/axis';
|
|
12
12
|
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
|
|
13
|
-
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
/**
|
|
15
15
|
* Solution of the equations
|
|
16
16
|
* W = barWidth * N + offset * (N-1)
|
|
@@ -20,7 +20,6 @@ import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
|
|
|
20
20
|
* @param gapRatio The ratio of the gap between bars over the bar width.
|
|
21
21
|
* @returns The bar width and the offset between bars.
|
|
22
22
|
*/
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
23
|
function getBandSize(_ref) {
|
|
25
24
|
var W = _ref.bandWidth,
|
|
26
25
|
N = _ref.numberOfGroups,
|
|
@@ -97,20 +96,21 @@ var useCompletedData = function useCompletedData() {
|
|
|
97
96
|
color = _series$seriesId.color;
|
|
98
97
|
return stackedData.map(function (values, dataIndex) {
|
|
99
98
|
var _xAxis$xAxisKey$data, _yAxis$yAxisKey$data;
|
|
100
|
-
var
|
|
101
|
-
|
|
99
|
+
var valueCoordinates = values.map(function (v) {
|
|
100
|
+
return verticalLayout ? yScale(v) : xScale(v);
|
|
101
|
+
});
|
|
102
|
+
var minValueCoord = Math.min.apply(Math, _toConsumableArray(valueCoordinates));
|
|
103
|
+
var maxValueCoord = Math.max.apply(Math, _toConsumableArray(valueCoordinates));
|
|
102
104
|
return {
|
|
103
|
-
bottom: bottom,
|
|
104
|
-
top: top,
|
|
105
105
|
seriesId: seriesId,
|
|
106
106
|
dataIndex: dataIndex,
|
|
107
107
|
layout: series[seriesId].layout,
|
|
108
|
-
x: verticalLayout ? xScale((_xAxis$xAxisKey$data = xAxis[xAxisKey].data) == null ? void 0 : _xAxis$xAxisKey$data[dataIndex]) + barOffset :
|
|
109
|
-
y: verticalLayout ?
|
|
108
|
+
x: verticalLayout ? xScale((_xAxis$xAxisKey$data = xAxis[xAxisKey].data) == null ? void 0 : _xAxis$xAxisKey$data[dataIndex]) + barOffset : minValueCoord,
|
|
109
|
+
y: verticalLayout ? minValueCoord : yScale((_yAxis$yAxisKey$data = yAxis[yAxisKey].data) == null ? void 0 : _yAxis$yAxisKey$data[dataIndex]) + barOffset,
|
|
110
110
|
xOrigin: xScale(0),
|
|
111
111
|
yOrigin: yScale(0),
|
|
112
|
-
height: verticalLayout ?
|
|
113
|
-
width: verticalLayout ? barWidth :
|
|
112
|
+
height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
|
|
113
|
+
width: verticalLayout ? barWidth : maxValueCoord - minValueCoord,
|
|
114
114
|
color: color,
|
|
115
115
|
highlightScope: series[seriesId].highlightScope
|
|
116
116
|
};
|
|
@@ -99,7 +99,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
99
99
|
* @default xAxisIds[0] The id of the first provided axis
|
|
100
100
|
*/
|
|
101
101
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
102
|
-
axisId: PropTypes.string,
|
|
102
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
103
103
|
classes: PropTypes.object,
|
|
104
104
|
disableLine: PropTypes.bool,
|
|
105
105
|
disableTicks: PropTypes.bool,
|
|
@@ -126,7 +126,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
126
126
|
* @default yAxisIds[0] The id of the first provided axis
|
|
127
127
|
*/
|
|
128
128
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
129
|
-
axisId: PropTypes.string,
|
|
129
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
130
130
|
classes: PropTypes.object,
|
|
131
131
|
disableLine: PropTypes.bool,
|
|
132
132
|
disableTicks: PropTypes.bool,
|
|
@@ -153,7 +153,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
153
153
|
* @default null
|
|
154
154
|
*/
|
|
155
155
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
156
|
-
axisId: PropTypes.string,
|
|
156
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
157
157
|
classes: PropTypes.object,
|
|
158
158
|
disableLine: PropTypes.bool,
|
|
159
159
|
disableTicks: PropTypes.bool,
|
|
@@ -190,7 +190,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
190
190
|
* @default null
|
|
191
191
|
*/
|
|
192
192
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
193
|
-
axisId: PropTypes.string,
|
|
193
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
194
194
|
classes: PropTypes.object,
|
|
195
195
|
disableLine: PropTypes.bool,
|
|
196
196
|
disableTicks: PropTypes.bool,
|