@yamada-ui/charts 1.1.10-next-20240630234753 → 1.2.0-dev-20240702155240

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.
Files changed (110) hide show
  1. package/dist/area-chart.js +112 -16
  2. package/dist/area-chart.js.map +1 -1
  3. package/dist/area-chart.mjs +11 -11
  4. package/dist/bar-chart.js +112 -16
  5. package/dist/bar-chart.js.map +1 -1
  6. package/dist/bar-chart.mjs +11 -11
  7. package/dist/chart-legend.mjs +3 -3
  8. package/dist/chart-tooltip.mjs +3 -3
  9. package/dist/chart.types.d.mts +2 -1
  10. package/dist/chart.types.d.ts +2 -1
  11. package/dist/chart.types.js.map +1 -1
  12. package/dist/{chunk-LM2DQK2P.mjs → chunk-5Q6O726L.mjs} +2 -2
  13. package/dist/{chunk-OW7SOTEF.mjs → chunk-62QDC3QC.mjs} +7 -7
  14. package/dist/{chunk-KNAADLWO.mjs → chunk-CBNHQGSK.mjs} +44 -14
  15. package/dist/chunk-CBNHQGSK.mjs.map +1 -0
  16. package/dist/{chunk-LGMALZCN.mjs → chunk-D7EZKGCJ.mjs} +2 -2
  17. package/dist/{chunk-STBYRLC5.mjs → chunk-DCILG4RR.mjs} +19 -3
  18. package/dist/chunk-DCILG4RR.mjs.map +1 -0
  19. package/dist/{chunk-NEGDEVRX.mjs → chunk-DGOXJ373.mjs} +2 -2
  20. package/dist/{chunk-E2I2XAZ6.mjs → chunk-DMVH7PWL.mjs} +44 -14
  21. package/dist/chunk-DMVH7PWL.mjs.map +1 -0
  22. package/dist/{chunk-4WX5YS7M.mjs → chunk-EQAWJ2NX.mjs} +7 -7
  23. package/dist/{chunk-OSNFBRHL.mjs → chunk-F34FV5DY.mjs} +13 -2
  24. package/dist/{chunk-OSNFBRHL.mjs.map → chunk-F34FV5DY.mjs.map} +1 -1
  25. package/dist/{chunk-QZ5OXZ6Z.mjs → chunk-FIWHBTKQ.mjs} +18 -3
  26. package/dist/chunk-FIWHBTKQ.mjs.map +1 -0
  27. package/dist/{chunk-KT4YOMM4.mjs → chunk-FVMZPU4D.mjs} +2 -2
  28. package/dist/{chunk-LHI57S6P.mjs → chunk-I6S3KP4X.mjs} +2 -2
  29. package/dist/{chunk-LUFKURIL.mjs → chunk-MR2GQ4BK.mjs} +44 -14
  30. package/dist/chunk-MR2GQ4BK.mjs.map +1 -0
  31. package/dist/{chunk-BPR7YL3O.mjs → chunk-PERBLBJU.mjs} +7 -7
  32. package/dist/{chunk-LBC2B6UX.mjs → chunk-PSJKBKOF.mjs} +2 -2
  33. package/dist/{chunk-MWPICUEW.mjs → chunk-Q7CCSKX3.mjs} +2 -2
  34. package/dist/{chunk-XIFDRM7J.mjs → chunk-STBYN5JW.mjs} +2 -2
  35. package/dist/{chunk-RN6PXJAD.mjs → chunk-UK6B6KJ7.mjs} +2 -2
  36. package/dist/{chunk-THT3VDBO.mjs → chunk-WPJDHMPD.mjs} +19 -3
  37. package/dist/chunk-WPJDHMPD.mjs.map +1 -0
  38. package/dist/{chunk-P7AFSM5W.mjs → chunk-XHDDK4ZU.mjs} +56 -14
  39. package/dist/chunk-XHDDK4ZU.mjs.map +1 -0
  40. package/dist/donut-chart.js.map +1 -1
  41. package/dist/donut-chart.mjs +8 -8
  42. package/dist/index.js +209 -24
  43. package/dist/index.js.map +1 -1
  44. package/dist/index.mjs +20 -20
  45. package/dist/line-chart.js +111 -16
  46. package/dist/line-chart.js.map +1 -1
  47. package/dist/line-chart.mjs +11 -11
  48. package/dist/pie-chart.js.map +1 -1
  49. package/dist/pie-chart.mjs +8 -8
  50. package/dist/radar-chart.js.map +1 -1
  51. package/dist/radar-chart.mjs +8 -8
  52. package/dist/rechart-properties.d.mts +2 -1
  53. package/dist/rechart-properties.d.ts +2 -1
  54. package/dist/rechart-properties.js +12 -0
  55. package/dist/rechart-properties.js.map +1 -1
  56. package/dist/rechart-properties.mjs +3 -1
  57. package/dist/use-area-chart.d.mts +9 -1
  58. package/dist/use-area-chart.d.ts +9 -1
  59. package/dist/use-area-chart.js +17 -1
  60. package/dist/use-area-chart.js.map +1 -1
  61. package/dist/use-area-chart.mjs +2 -2
  62. package/dist/use-bar-chart.d.mts +9 -1
  63. package/dist/use-bar-chart.d.ts +9 -1
  64. package/dist/use-bar-chart.js +17 -1
  65. package/dist/use-bar-chart.js.map +1 -1
  66. package/dist/use-bar-chart.mjs +2 -2
  67. package/dist/use-chart-axis.d.mts +20 -2
  68. package/dist/use-chart-axis.d.ts +20 -2
  69. package/dist/use-chart-axis.js +63 -12
  70. package/dist/use-chart-axis.js.map +1 -1
  71. package/dist/use-chart-axis.mjs +2 -2
  72. package/dist/use-chart-grid.js.map +1 -1
  73. package/dist/use-chart-grid.mjs +2 -2
  74. package/dist/use-chart-legend.js.map +1 -1
  75. package/dist/use-chart-legend.mjs +2 -2
  76. package/dist/use-chart-reference-line.js.map +1 -1
  77. package/dist/use-chart-reference-line.mjs +2 -2
  78. package/dist/use-chart-tooltip.js.map +1 -1
  79. package/dist/use-chart-tooltip.mjs +2 -2
  80. package/dist/use-chart.js.map +1 -1
  81. package/dist/use-chart.mjs +2 -2
  82. package/dist/use-line-chart.d.mts +9 -1
  83. package/dist/use-line-chart.d.ts +9 -1
  84. package/dist/use-line-chart.js +16 -1
  85. package/dist/use-line-chart.js.map +1 -1
  86. package/dist/use-line-chart.mjs +2 -2
  87. package/dist/use-pie-chart.js.map +1 -1
  88. package/dist/use-pie-chart.mjs +2 -2
  89. package/dist/use-radar-chart.js.map +1 -1
  90. package/dist/use-radar-chart.mjs +2 -2
  91. package/package.json +3 -3
  92. package/dist/chunk-E2I2XAZ6.mjs.map +0 -1
  93. package/dist/chunk-KNAADLWO.mjs.map +0 -1
  94. package/dist/chunk-LUFKURIL.mjs.map +0 -1
  95. package/dist/chunk-P7AFSM5W.mjs.map +0 -1
  96. package/dist/chunk-QZ5OXZ6Z.mjs.map +0 -1
  97. package/dist/chunk-STBYRLC5.mjs.map +0 -1
  98. package/dist/chunk-THT3VDBO.mjs.map +0 -1
  99. /package/dist/{chunk-LM2DQK2P.mjs.map → chunk-5Q6O726L.mjs.map} +0 -0
  100. /package/dist/{chunk-OW7SOTEF.mjs.map → chunk-62QDC3QC.mjs.map} +0 -0
  101. /package/dist/{chunk-LGMALZCN.mjs.map → chunk-D7EZKGCJ.mjs.map} +0 -0
  102. /package/dist/{chunk-NEGDEVRX.mjs.map → chunk-DGOXJ373.mjs.map} +0 -0
  103. /package/dist/{chunk-4WX5YS7M.mjs.map → chunk-EQAWJ2NX.mjs.map} +0 -0
  104. /package/dist/{chunk-KT4YOMM4.mjs.map → chunk-FVMZPU4D.mjs.map} +0 -0
  105. /package/dist/{chunk-LHI57S6P.mjs.map → chunk-I6S3KP4X.mjs.map} +0 -0
  106. /package/dist/{chunk-BPR7YL3O.mjs.map → chunk-PERBLBJU.mjs.map} +0 -0
  107. /package/dist/{chunk-LBC2B6UX.mjs.map → chunk-PSJKBKOF.mjs.map} +0 -0
  108. /package/dist/{chunk-MWPICUEW.mjs.map → chunk-Q7CCSKX3.mjs.map} +0 -0
  109. /package/dist/{chunk-XIFDRM7J.mjs.map → chunk-STBYN5JW.mjs.map} +0 -0
  110. /package/dist/{chunk-RN6PXJAD.mjs.map → chunk-UK6B6KJ7.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -506,6 +506,16 @@ var polarRadiusAxisProperties = [
506
506
  "onMouseEnter",
507
507
  "onMouseLeave"
508
508
  ];
509
+ var labelProperties = [
510
+ "viewBox",
511
+ "formatter",
512
+ "value",
513
+ "position",
514
+ "offset",
515
+ "children",
516
+ "content",
517
+ "id"
518
+ ];
509
519
 
510
520
  // src/use-chart.ts
511
521
  var [ChartProvider, useChartContext] = (0, import_utils2.createContext)({
@@ -673,12 +683,14 @@ var useChartAxis = ({
673
683
  gridAxis = "x",
674
684
  withXAxis = true,
675
685
  withYAxis = true,
676
- xAxisProps: _xAxisProps = {},
677
- yAxisProps: _yAxisProps = {},
686
+ xAxisLabel: xAxisLabelProp,
687
+ yAxisLabel: yAxisLabelProp,
678
688
  unit,
679
689
  valueFormatter,
680
- styles
690
+ styles,
691
+ ...rest
681
692
  }) => {
693
+ var _a, _b, _c, _d;
682
694
  const { theme } = (0, import_core5.useTheme)();
683
695
  const xAxisKey = (0, import_react2.useMemo)(
684
696
  () => layoutType === "vertical" ? { type: "number" } : { dataKey },
@@ -695,14 +707,24 @@ var useChartAxis = ({
695
707
  const yTickLine = getTickLine(withYTickLine);
696
708
  const yAxisTickFormatter = type === "percent" && layoutType !== "vertical" ? valueToPercent : valueFormatter;
697
709
  const xAxisTickFormatter = type === "percent" && layoutType === "vertical" ? valueToPercent : valueFormatter;
698
- const [xAxisReChartsProps, xAxisClassName] = getComponentProps(
699
- [_xAxisProps, xAxisProperties],
710
+ const xAxisLabel = layoutType === "vertical" ? yAxisLabelProp : xAxisLabelProp;
711
+ const yAxisLabel = layoutType === "vertical" ? xAxisLabelProp : yAxisLabelProp;
712
+ const [xAxisProps, xAxisClassName] = getComponentProps(
713
+ [(_a = rest.xAxisProps) != null ? _a : {}, xAxisProperties],
700
714
  styles.xAxis
701
715
  )(theme);
702
- const [yAxisReChartsProps, yAxisClassName] = getComponentProps(
703
- [_yAxisProps, yAxisProperties],
716
+ const [yAxisProps, yAxisClassName] = getComponentProps(
717
+ [(_b = rest.yAxisProps) != null ? _b : {}, yAxisProperties],
704
718
  styles.yAxis
705
719
  )(theme);
720
+ const [xAxisLabelProps, xAxisLabelClassName] = getComponentProps(
721
+ [(_c = rest.xAxisLabelProps) != null ? _c : {}, labelProperties],
722
+ styles.xAxisLabel
723
+ )(theme);
724
+ const [yAxisLabelProps, yAxisLabelClassName] = getComponentProps(
725
+ [(_d = rest.yAxisLabelProps) != null ? _d : {}, labelProperties],
726
+ styles.yAxisLabel
727
+ )(theme);
706
728
  const getXAxisProps = (0, import_react2.useCallback)(
707
729
  ({ className, ...props } = {}) => ({
708
730
  className: (0, import_utils5.cx)(className, xAxisClassName),
@@ -718,7 +740,7 @@ var useChartAxis = ({
718
740
  minTickGap: 5,
719
741
  tickFormatter: xAxisTickFormatter,
720
742
  ...props,
721
- ...xAxisReChartsProps
743
+ ...xAxisProps
722
744
  }),
723
745
  [
724
746
  xAxisClassName,
@@ -726,7 +748,7 @@ var useChartAxis = ({
726
748
  xAxisKey,
727
749
  xTickLine,
728
750
  xAxisTickFormatter,
729
- xAxisReChartsProps
751
+ xAxisProps
730
752
  ]
731
753
  );
732
754
  const getYAxisProps = (0, import_react2.useCallback)(
@@ -744,7 +766,7 @@ var useChartAxis = ({
744
766
  unit,
745
767
  tickFormatter: yAxisTickFormatter,
746
768
  ...props,
747
- ...yAxisReChartsProps
769
+ ...yAxisProps
748
770
  }),
749
771
  [
750
772
  yAxisClassName,
@@ -753,10 +775,39 @@ var useChartAxis = ({
753
775
  yTickLine,
754
776
  unit,
755
777
  yAxisTickFormatter,
756
- yAxisReChartsProps
778
+ yAxisProps
757
779
  ]
758
780
  );
759
- return { getXAxisProps, getYAxisProps };
781
+ const getXAxisLabelProps = (0, import_react2.useCallback)(
782
+ ({ className, ...props } = {}) => ({
783
+ className: (0, import_utils5.cx)(className, xAxisLabelClassName),
784
+ value: xAxisLabel,
785
+ position: "insideBottom",
786
+ offset: -20,
787
+ ...props,
788
+ ...xAxisLabelProps
789
+ }),
790
+ [xAxisLabel, xAxisLabelClassName, xAxisLabelProps]
791
+ );
792
+ const getYAxisLabelProps = (0, import_react2.useCallback)(
793
+ ({ className, ...props } = {}) => ({
794
+ className: (0, import_utils5.cx)(className, yAxisLabelClassName),
795
+ value: yAxisLabel,
796
+ position: "insideLeft",
797
+ angle: -90,
798
+ textAnchor: "middle",
799
+ offset: -5,
800
+ ...props,
801
+ ...yAxisLabelProps
802
+ }),
803
+ [yAxisLabel, yAxisLabelClassName, yAxisLabelProps]
804
+ );
805
+ return {
806
+ getXAxisProps,
807
+ getYAxisProps,
808
+ getXAxisLabelProps,
809
+ getYAxisLabelProps
810
+ };
760
811
  };
761
812
  var valueToPercent = (value) => {
762
813
  return `${(value * 100).toFixed(0)}%`;
@@ -911,6 +962,8 @@ var useLineChart = ({
911
962
  referenceLineProps,
912
963
  fillOpacity = 1,
913
964
  syncId,
965
+ xAxisLabel,
966
+ yAxisLabel,
914
967
  styles,
915
968
  ...rest
916
969
  }) => {
@@ -1097,10 +1150,23 @@ var useLineChart = ({
1097
1150
  data,
1098
1151
  layout: layoutType,
1099
1152
  syncId,
1153
+ margin: {
1154
+ bottom: xAxisLabel ? 30 : void 0,
1155
+ left: yAxisLabel ? 10 : void 0,
1156
+ right: yAxisLabel ? 5 : void 0
1157
+ },
1100
1158
  ...props,
1101
1159
  ...chartProps
1102
1160
  }),
1103
- [data, layoutType, syncId, lineChartClassName, chartProps]
1161
+ [
1162
+ lineChartClassName,
1163
+ data,
1164
+ layoutType,
1165
+ syncId,
1166
+ xAxisLabel,
1167
+ yAxisLabel,
1168
+ chartProps
1169
+ ]
1104
1170
  );
1105
1171
  const getLineProps = (0, import_react7.useCallback)(
1106
1172
  ({ index, className: classNameProp, ...props }, ref = null) => {
@@ -1150,6 +1216,10 @@ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
1150
1216
  withYAxis,
1151
1217
  xAxisProps,
1152
1218
  yAxisProps,
1219
+ xAxisLabel,
1220
+ yAxisLabel,
1221
+ xAxisLabelProps,
1222
+ yAxisLabelProps,
1153
1223
  unit,
1154
1224
  valueFormatter,
1155
1225
  referenceLineProps,
@@ -1185,10 +1255,17 @@ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
1185
1255
  connectNulls,
1186
1256
  fillOpacity,
1187
1257
  syncId,
1258
+ xAxisLabel,
1259
+ yAxisLabel,
1188
1260
  styles
1189
1261
  });
1190
1262
  const { getContainerProps } = useChart({ containerProps });
1191
- const { getXAxisProps, getYAxisProps } = useChartAxis({
1263
+ const {
1264
+ getXAxisProps,
1265
+ getYAxisProps,
1266
+ getXAxisLabelProps,
1267
+ getYAxisLabelProps
1268
+ } = useChartAxis({
1192
1269
  dataKey,
1193
1270
  type,
1194
1271
  layoutType,
@@ -1198,6 +1275,10 @@ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
1198
1275
  withYAxis,
1199
1276
  xAxisProps,
1200
1277
  yAxisProps,
1278
+ xAxisLabel,
1279
+ yAxisLabel,
1280
+ xAxisLabelProps,
1281
+ yAxisLabelProps,
1201
1282
  unit,
1202
1283
  valueFormatter,
1203
1284
  styles
@@ -1266,8 +1347,22 @@ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
1266
1347
  ...getGridProps({ className: "ui-line-chart__grid" })
1267
1348
  }
1268
1349
  ),
1269
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.XAxis, { ...getXAxisProps({ className: "ui-line-chart__x-axis" }) }),
1270
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.YAxis, { ...getYAxisProps({ className: "ui-line-chart__y-axis" }) }),
1350
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.XAxis, { ...getXAxisProps({ className: "ui-line-chart__x-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1351
+ import_recharts.Label,
1352
+ {
1353
+ ...getXAxisLabelProps({
1354
+ className: "ui-line-chart__x-axis-label"
1355
+ })
1356
+ }
1357
+ ) }),
1358
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.YAxis, { ...getYAxisProps({ className: "ui-line-chart__y-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1359
+ import_recharts.Label,
1360
+ {
1361
+ ...getYAxisLabelProps({
1362
+ className: "ui-line-chart__y-axis-label"
1363
+ })
1364
+ }
1365
+ ) }),
1271
1366
  withLegend ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1272
1367
  import_recharts.Legend,
1273
1368
  {
@@ -1329,6 +1424,8 @@ var useBarChart = ({
1329
1424
  referenceLineProps = [],
1330
1425
  fillOpacity = 1,
1331
1426
  syncId,
1427
+ xAxisLabel,
1428
+ yAxisLabel,
1332
1429
  styles,
1333
1430
  ...rest
1334
1431
  }) => {
@@ -1494,10 +1591,24 @@ var useBarChart = ({
1494
1591
  stackOffset: type === "percent" ? "expand" : void 0,
1495
1592
  layout: layoutType,
1496
1593
  syncId,
1594
+ margin: {
1595
+ bottom: xAxisLabel ? 30 : void 0,
1596
+ left: yAxisLabel ? 10 : void 0,
1597
+ right: yAxisLabel ? 5 : void 0
1598
+ },
1497
1599
  ...props,
1498
1600
  ...chartProps
1499
1601
  }),
1500
- [barChartClassName, chartProps, data, syncId, layoutType, type]
1602
+ [
1603
+ barChartClassName,
1604
+ data,
1605
+ type,
1606
+ layoutType,
1607
+ syncId,
1608
+ xAxisLabel,
1609
+ yAxisLabel,
1610
+ chartProps
1611
+ ]
1501
1612
  );
1502
1613
  return {
1503
1614
  barVars,
@@ -1523,6 +1634,10 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
1523
1634
  barProps,
1524
1635
  xAxisProps,
1525
1636
  yAxisProps,
1637
+ xAxisLabel,
1638
+ yAxisLabel,
1639
+ xAxisLabelProps,
1640
+ yAxisLabelProps,
1526
1641
  type = "default",
1527
1642
  withTooltip = true,
1528
1643
  withLegend = false,
@@ -1551,10 +1666,17 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
1551
1666
  referenceLineProps,
1552
1667
  fillOpacity,
1553
1668
  syncId,
1669
+ xAxisLabel,
1670
+ yAxisLabel,
1554
1671
  styles
1555
1672
  });
1556
1673
  const { getContainerProps } = useChart({ containerProps });
1557
- const { getXAxisProps, getYAxisProps } = useChartAxis({
1674
+ const {
1675
+ getXAxisProps,
1676
+ getYAxisProps,
1677
+ getXAxisLabelProps,
1678
+ getYAxisLabelProps
1679
+ } = useChartAxis({
1558
1680
  dataKey,
1559
1681
  type,
1560
1682
  layoutType,
@@ -1564,6 +1686,10 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
1564
1686
  withYAxis,
1565
1687
  xAxisProps,
1566
1688
  yAxisProps,
1689
+ xAxisLabel,
1690
+ yAxisLabel,
1691
+ xAxisLabelProps,
1692
+ yAxisLabelProps,
1567
1693
  unit,
1568
1694
  valueFormatter,
1569
1695
  styles
@@ -1634,8 +1760,22 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
1634
1760
  ...getGridProps({ className: "ui-bar-chart__grid" })
1635
1761
  }
1636
1762
  ),
1637
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.XAxis, { ...getXAxisProps({ className: "ui-bar-chart__x-axis" }) }),
1638
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.YAxis, { ...getYAxisProps({ className: "ui-bar-chart__y-axis" }) }),
1763
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.XAxis, { ...getXAxisProps({ className: "ui-bar-chart__x-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1764
+ import_recharts2.Label,
1765
+ {
1766
+ ...getXAxisLabelProps({
1767
+ className: "ui-bar-chart__x-axis-label"
1768
+ })
1769
+ }
1770
+ ) }),
1771
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.YAxis, { ...getYAxisProps({ className: "ui-bar-chart__y-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1772
+ import_recharts2.Label,
1773
+ {
1774
+ ...getYAxisLabelProps({
1775
+ className: "ui-bar-chart__y-axis-label"
1776
+ })
1777
+ }
1778
+ ) }),
1639
1779
  withLegend ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1640
1780
  import_recharts2.Legend,
1641
1781
  {
@@ -1746,6 +1886,8 @@ var useAreaChart = ({
1746
1886
  splitOffset,
1747
1887
  referenceLineProps,
1748
1888
  syncId,
1889
+ xAxisLabel,
1890
+ yAxisLabel,
1749
1891
  styles,
1750
1892
  ...rest
1751
1893
  }) => {
@@ -1962,10 +2104,24 @@ var useAreaChart = ({
1962
2104
  stackOffset: type === "percent" ? "expand" : void 0,
1963
2105
  layout: layoutType,
1964
2106
  syncId,
2107
+ margin: {
2108
+ bottom: xAxisLabel ? 30 : void 0,
2109
+ left: yAxisLabel ? 10 : void 0,
2110
+ right: yAxisLabel ? 5 : void 0
2111
+ },
1965
2112
  ...props,
1966
2113
  ...chartProps
1967
2114
  }),
1968
- [areaChartClassName, data, type, layoutType, syncId, chartProps]
2115
+ [
2116
+ areaChartClassName,
2117
+ data,
2118
+ type,
2119
+ layoutType,
2120
+ syncId,
2121
+ xAxisLabel,
2122
+ yAxisLabel,
2123
+ chartProps
2124
+ ]
1969
2125
  );
1970
2126
  const getAreaSplitProps = (0, import_react11.useCallback)(
1971
2127
  (props = {}) => ({
@@ -2051,6 +2207,10 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
2051
2207
  withYAxis,
2052
2208
  xAxisProps,
2053
2209
  yAxisProps,
2210
+ xAxisLabel,
2211
+ yAxisLabel,
2212
+ xAxisLabelProps,
2213
+ yAxisLabelProps,
2054
2214
  type = "default",
2055
2215
  withTooltip = true,
2056
2216
  withLegend = false,
@@ -2103,10 +2263,17 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
2103
2263
  splitColors,
2104
2264
  splitOffset,
2105
2265
  syncId,
2266
+ xAxisLabel,
2267
+ yAxisLabel,
2106
2268
  styles
2107
2269
  });
2108
2270
  const { getContainerProps } = useChart({ containerProps });
2109
- const { getXAxisProps, getYAxisProps } = useChartAxis({
2271
+ const {
2272
+ getXAxisProps,
2273
+ getYAxisProps,
2274
+ getXAxisLabelProps,
2275
+ getYAxisLabelProps
2276
+ } = useChartAxis({
2110
2277
  dataKey,
2111
2278
  type,
2112
2279
  layoutType,
@@ -2116,6 +2283,10 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
2116
2283
  withYAxis,
2117
2284
  xAxisProps,
2118
2285
  yAxisProps,
2286
+ xAxisLabel,
2287
+ yAxisLabel,
2288
+ xAxisLabelProps,
2289
+ yAxisLabelProps,
2119
2290
  unit,
2120
2291
  valueFormatter,
2121
2292
  styles
@@ -2187,8 +2358,22 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
2187
2358
  ...getGridProps({ className: "ui-area-chart__grid" })
2188
2359
  }
2189
2360
  ),
2190
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_recharts3.XAxis, { ...getXAxisProps({ className: "ui-area-chart__x-axis" }) }),
2191
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_recharts3.YAxis, { ...getYAxisProps({ className: "ui-area-chart__y-axis" }) }),
2361
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_recharts3.XAxis, { ...getXAxisProps({ className: "ui-area-chart__x-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2362
+ import_recharts3.Label,
2363
+ {
2364
+ ...getXAxisLabelProps({
2365
+ className: "ui-area-chart__x-axis-label"
2366
+ })
2367
+ }
2368
+ ) }),
2369
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_recharts3.YAxis, { ...getYAxisProps({ className: "ui-area-chart__y-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2370
+ import_recharts3.Label,
2371
+ {
2372
+ ...getYAxisLabelProps({
2373
+ className: "ui-area-chart__y-axis-label"
2374
+ })
2375
+ }
2376
+ ) }),
2192
2377
  withLegend ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2193
2378
  import_recharts3.Legend,
2194
2379
  {