遵循文档并尝试从3.0.1升级到8.0.4会产生未定义的错误

时间:2020-11-09 01:43:18

标签: highcharts

->我试图遵循您的文档。我们使用骨干和requirejs。我使用以下命令下载了gradle程序包

compile 'org.webjars:highcharts:8.0.4'

->我在下面添加的requirejs配置文件内部:

packages: [{
      name: 'highcharts',
      main: 'highcharts'
  }],

'highcharts': '../../webjars/highcharts/8.0.4/highcharts',
    'highcharts-exporting': '../../webjars/highcharts/8.0.4/modules/exporting',
    'highcharts-accessibility': '../../webjars/highcharts/8.0.4/modules/accessibility',
    'highchartsCommon':'./highchartsCommon',```

--> highchartsCommon.js below:
```
define ([ 'highcharts',
    'highcharts-exporting',
    'highcharts-accessibility'] , require([
    'highcharts',
    'highcharts-exporting',
    'highcharts-accessibility'
    ], function (highchart)
        {
            window.Highcharts= highchart;
            return highchart;
        }
));

define(['abcd', 'xyza', 'abdc12', 'hxhxh', 'highchartsCommon', 'jquery'], function (Abcd, Ayza, Abcd12, Hxhxh, Highcharts) {

console.log(Highcharts.chart);
        var optionsSample = {
            chart: {
                renderTo: 'container',
                type: 'bar'
            },
            series: [{
                name: 'Jane',
                data: [1, 0, 4]
            }]
        };
      this.chart = new Highcharts.Chart(optionsSample);

对于控制台日志输出,我不确定,并且由于输入错误而无法找到功能图表。

异常为Uncaught TypeError: Highcharts.Chart is not a constructor 任何帮助表示赞赏。

0 个答案:

没有答案