()
| 20 | const ChartContext = React.createContext<ChartContextProps | null>(null); |
| 21 | |
| 22 | function useChart() { |
| 23 | const context = React.useContext(ChartContext); |
| 24 | |
| 25 | if (!context) { |
| 26 | throw new Error("useChart must be used within a <ChartContainer />"); |
| 27 | } |
| 28 | |
| 29 | return context; |
| 30 | } |
| 31 | |
| 32 | const ChartContainer = React.forwardRef< |
| 33 | HTMLDivElement, |