admin管理员组文章数量:1122832
My problem is pretty simple: I have an HTML code block with an AJAX query that builds a perfectly fine chart using Apex Charts. When I duplicate this HTML block, it doesn't display one of the charts, only the first one.
I've tried using different links for the two AJAX calls but it still doesn't work. When logging the results on the console, no information regarding the second call is shown.
I'm fairly new to WP and JS so I'm worried that this is an expected behaviour and I'm just wasting time. Thanks for any help!
Edit: it shows both calls on the console after all. But the chart is not showing.
My problem is pretty simple: I have an HTML code block with an AJAX query that builds a perfectly fine chart using Apex Charts. When I duplicate this HTML block, it doesn't display one of the charts, only the first one.
I've tried using different links for the two AJAX calls but it still doesn't work. When logging the results on the console, no information regarding the second call is shown.
I'm fairly new to WP and JS so I'm worried that this is an expected behaviour and I'm just wasting time. Thanks for any help!
Edit: it shows both calls on the console after all. But the chart is not showing.
Share Improve this question edited Mar 20, 2023 at 17:39 user38680 asked Mar 20, 2023 at 17:29 user38680user38680 11 bronze badge 3 |1 Answer
Reset to default 0I had a similar problem. I had two graphs on one html page. In JS I had two options variables.
When I used 'responsive' section in options of every graphs, the second graph wasn't displayed and there were an error in console 'Maximum call stack size exceeded'.
In my case helped to remove id fields from options of both graphs.
Before:
var options1 = {
chart: {
id: 'graph1',
type: 'bar',
...
var options2 = {
chart: {
id: 'graph2',
type: 'bar',
...
After:
var options1 = {
chart: {
type: 'bar',
...
var options2 = {
chart: {
type: 'bar',
...
It is strange anyway and it must be some bug in Apex Charts (I used version 3.49).
本文标签: ajaxCan39t have two simultaneous charts using Apex Charts
版权声明:本文标题:ajax - Can't have two simultaneous charts using Apex Charts 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736306402a1932945.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
unfiltered_html
capability, that also means if someone who is not an admin edits the post all that code dissapears. Putting JS script tags directly into post content is not how you embed things in WP, that's what shortcodes/blocks/OEmbed is for. In the meantime you should ask about this in an Apex charts community, both the problem and the solution are unlikely to be WordPress problems – Tom J Nowell ♦ Commented Jun 26, 2023 at 13:08