Closed adityakoushikr11 closed 5 months ago
You are passing series prop inside options object when it should be outside of it and passed as a prop to <Chart>
component.
The correct code should be
<Chart
series='[{ name: "My chart", data: [{ x: "Mo", y: 2 }, { x: "Tu", y: 3 }] }]'
type="bar"
options={{
colors: ["#EC6E00", "#FF961B", "#FDD08D", "#D4E3A8", "#99E48D", "#99E48D", "#99E48D"]
}}
/>
I am trying to render a bar chart but i am getting the following error "Failed prop type: The prop
series
is marked as required inr
, but its value isundefined
."I am passing the following information to the chart. <Chart type="bar" options={{ chart: { type: "bar" }, series: [{ name: "My chart", data: [{ x: "Mo", y: 2 }, { x: "Tu", y: 3 }] }], colors: ["#EC6E00", "#FF961B", "#FDD08D", "#D4E3A8", "#99E48D", "#99E48D", "#99E48D"] }} />
React apexchart version installed is : 1.4.1 Apexchart version : 3.45.2 Node version : 18 React version : 18.2.0