高图表热图 未捕获类型错误:无法读取未定义的属性“原型”

highcharts heatmap Uncaught TypeError: Cannot read property 'prototype' of undefined

本文关键字:未定义 读取 属性 原型 错误 类型 高图表      更新时间:2023-09-26

首先对不起我的英语,这不是我的母语。

我在另一个库的 StackOverflow 中发现了这个通用错误,但无法解决我的问题。

我有一个带有高图表的 RoR 应用程序,我使用图表条和柱形图没有问题,但现在我尝试添加热图并抛出此错误(当我包含热图时,我的其他图表也爆炸了):

Uncaught TypeError: Cannot read property 'prototype' of undefined 
Uncaught TypeError: chartBarContentsGenerator is not a function(anonymous function) @ report:262
report:328 Uncaught TypeError: chartBarContentsGenerator is not a function(anonymous function) @ report:328
application-babd633118c80bce803babb844831d35.js:30318 Uncaught Highcharts error #17: www.highcharts.com/errors/17

我的应用程序.js看起来像这样:

//= require highcharts/highcharts
//= require highcharts/modules/heatmap
//= require highcharts/highcharts-more

我尝试更新高图表,包括更多文件,如导出.js、highstock.js,更改行的顺序,但没有任何效果。

这是我的jsfiddle,这个图表工作

https://jsfiddle.net/llermaly/pay7pe9u/2/

*新信息:

我将这 2 行添加到我的应用程序 .html.erb 而不是使用 js 资产,但现在只有热图图表有效

    <script type="text/javascript" src="https://code.highcharts.com/stock/highstock.js"></script>
<script type="text/javascript" src="https://code.highcharts.com/modules/heatmap.js"></script>

任何评论不胜感激。

问候

我没有

注意到版本,我使用的是旧版本的highcharts(4.1.9),然后我包含了最新版本的热图(4.2.3)并遇到了此错误,然后我将所有文件更新到4.2.3,但与另一个js文件冲突。

最后,我将热图和高图都降级到4.1.9v,并:)

我希望这对某人有所帮助