React Hooks ApexCharts.exec
See original GitHub issueexport default function ExampleChart({
data,
...props
}) {
let series = data
useEffect(() => {
ApexCharts.exec("example", 'updateSeries', series)
}, [series]);
return (
<Charts
options={options}
series={[]}
type={"area"}
height={300}
/>
);
}
let options = {
chart: {
id: "example",
group: "example-groups"
},
...
}
gives the error TypeError: i.publicMethods is undefined
at line ApexCharts.exec("example", 'updateSeries', series)
. Error is probably because I’m using it incorrectly.
What is the correct way to update series using React Hooks?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:8
Top Results From Across the Web
Apexcharts With Function Component #3 Tutorial - YouTube
Render Dynamic Data Using An API In Apexcharts with hooks | Apexcharts with function #4 Tutorial · React Hook useRef and forwarding refs...
Read more >React Apex Chart Using Hooks - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >A React Chart wrapper for ApexCharts.js
React -ApexCharts is a wrapper component for ApexCharts ready to be integrated into your react.js application to create stunning React Charts.
Read more >Charting in React with ApexCharts - LogRocket Blog
Charting in React with ApexCharts · Responsiveness: Your charts will scale according to the viewing device. · Annotations: Apex also allows you to ......
Read more >React ApexCharts update chart with interval - Stack Overflow
You are passing no dependencies to useEffect. This makes it run on every render which makes your charts redraw very often.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This solution works
@thellimist It looks like that it works fine : https://codesandbox.io/s/react-basic-example-7xce1
However, it seems that your example is a bit of nonsense. What is the point of updating the series by calling the method updateSeries in a useEffect Hook ? If you update the props data in your example, the Chart will also update with the new props…
<Chart options={options} series={series} type="area" width="300" />