Force Highcharts to use standalone framework instead of jquery?

I am currently using Highcharts 3.0.1 with Jquery 1.7.2. I would like to upgrade Jquery to the latest version (3.2.1) but I know even the current version of Highcharts officially only supports version 2.x of Jquery. Since Highcharts does have a standalone framework, can I force it to use that instead of jquery so that I no longer have a dependency on jquery? Or will it automatically use jquery if it is available? Ideally I would like to do this with version 3.0.1 of Highcharts, but I can upgrade to 5.x if necessary.


You can run two versions of jQuery side by side using jQuery's noconflict method. This should allow you to upgrade the version of jQuery that you are using independently from the version of jQuery that the framework is using.

See https://api.jquery.com/jquery.noconflict/.

If for some reason two versions of jQuery are loaded (which is not recommended), calling $.noConflict( true ) from the second version will return the globally scoped jQuery variables to those of the first version.


There's an adapter that allows you to use Highcharts without jQuery. I needed to do this once and it worked fine.

Refer to http://code.stephenmorley.org/javascript/using-highcharts-without-jquery/ and download the js file.

The pattern to create a chart will be something like this:

runOnLoad(function(){
  new Highcharts.Chart({
    chart : {
      renderTo : 'container'
      type     : 'bar'
    },
    // other options
  });
});
链接地址: http://www.djcxy.com/p/74456.html

上一篇: Highcharts助推器不能在风格模式下工作

下一篇: 强制Highcharts使用独立框架而不是jQuery?