()
| 26 | const ChartContext = React.createContext<ChartContextProps | null>(null); |
| 27 | |
| 28 | function useChart() { |
| 29 | const context = React.useContext(ChartContext); |
| 30 | |
| 31 | if (!context) { |
| 32 | throw new Error("useChart must be used within a <ChartContainer />"); |
| 33 | } |
| 34 | |
| 35 | return context; |
| 36 | } |
| 37 | |
| 38 | const ChartContainer = React.forwardRef< |
| 39 | HTMLDivElement, |