jengraph
Posts: 2
Joined: Thu Apr 22, 2021 4:48 pm

Using Highcharts on a page with Divi theme, sticky menu does not stick

It appears that when I remove the script for the horizontal bar chart, the sticky menu stays as it should but the horizontal bar chart disappears. How can I maintain both jQuery scripts for Divi sticky menu and highcharts modules. What would be the best way to handle this?

FYI I have a code module on this page to call all scripts for the Highcharts modules on this page only (we do not want highcharts jQuery on all pages if possible to reduce calls).
https://www.floods.org/membership-commu ... al-report/

It had worked a time or two when I removed the jquery in the page but later saw that it is blank for the bar charts (ASFPM Membership section). I left it in there so you can see the sticky menu conflict. Please advise. Thank you!
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Using Highcharts on a page with Divi theme, sticky menu does not stick

Hello! Welcome to the official highcharts forum, and thanks for contacting us with your question!
From the sole description it is hard to say, what is wrong. Could you reproduce the issue in some kind of editor, so we can see, what the issue is, and where we can see your code? Kind regards,
Paweł Lysy
Highcharts Developer
jengraph
Posts: 2
Joined: Thu Apr 22, 2021 4:48 pm

Re: Using Highcharts on a page with Divi theme, sticky menu does not stick

Hello, It is hard to reproduce in CodePen since Divi theme uses a jQuery script and then there is the jQuery script Highcharts uses, if I remove that script on the page, then the horizontal bar chart does not appear (hoping that the divi jQuery would work). So is there a way to isolated the jQuery script on the page to the module only without affecting the upper primary menu on the site? You can view the page on the site to see the jQuery there. Let me now. I really need to have the sticky menu working, when I remove the jQuery script for the bar chart the sticky menu works as it should but then the bar chart disappears.
User avatar
KacperMadej
Posts: 4632
Joined: Mon Sep 15, 2014 12:43 pm

Re: Using Highcharts on a page with Divi theme, sticky menu does not stick

Hello,

> there is the jQuery script Highcharts uses

Highcharts doesn't require jQuery to work. Highcharts only registers itself as a jQuery plugin for better synergy and backward compatibility.
Highcharts looks for jQuery on the window (global variable) and installs itself as a plugin only then.

Errors in the browser console on your site should help with resolving the problem.
Highcharts error #16
This means you are trying to load Highcharts again. For the version that you are using (9.1.0) it won't be a problem as nothing will happen - if Highcharts are already loaded then autodetection prevents any overload/overwrite (mostly to protect any modules or plugins that might get disrupted on reload of the core of Highcharts).
However, this should let you know that you are not loading Highcharts correctly and that you should remove all redundant library loading attempts.

TypeError: $(...).stickThis is not a function
This will happen when you are trying to execute the jQuery plugin jq-sticky-anything before it is loaded. Please check the scripts execution order to ensure that all needed libraries and utility scripts are loaded (and initialized if needed) before accessing the features they provide.

Uncaught (in promise) Error: Container is not defined
Is also showing but I am not sure if this is something related or maybe even a side effect of some previous errors. Resolving the first 2 errors should help with identifying this problem.

Could you set up another site that would show the second problem that you reported (the lack of the bar chart (and btw. a horizontal bar is called a column in Highcharts docs))?

Best Regards,
Kacper Madej
Highcharts Developer

Return to “Highcharts Usage”