gpt4 book ai didi

javascript - Highcharts 错误 #19

转载 作者:行者123 更新时间:2023-12-01 05:47:37 25 4
gpt4 key购买 nike

我正在使用 highcharts 绘制系列图表、x 轴上的时间和 y 轴上的数字。我使用的代码是:

$(function () {
$('#container').highcharts({
chart: {
type: 'spline'
},
title: {
text: '<span style="font-weight: bold; color: #B09730">Alert# ' + s[0] + '</span>'
},
subtitle: {
text: 'Start Date: ' + s[3] + " End Date: " + s[4] + "(" + s[5] + ")"
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { // don't display the dummy year
month: '%e. %b',
year: '%b',
day: '%d'
},
title: {
text: 'Time'
},
},
yAxis: {
title: {
text: 'Alert Size'
},
min: 0,
},
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: '{point.x:%e. %b}: {point.y:.2f}'
},
series: [{
name: 'Point',
// Define the data points. All series have a dummy year
// of 1970/71 in order to be compared on the same x axis. Note
// that in JavaScript, months start at 0 for January, 1 for February etc.
data: [
[1441293135000, 50],
[1441293195000, 100],
[1441293255000, 150],
[1441293315000, 250],
[1441293375000, 50]
]
}]
});
});

这段代码在 chrome 上工作正常,但在 mozilla firefox 上不起作用,它给了我错误:

uncaught exception: Highcharts error #19: www.highcharts.com/errors/19

有什么帮助吗?

最佳答案

终于成功了,问题出在我的html元素的css属性中,我的html代码是这样的:

    <div style="border: 1px solid #ccc; padding:10px; margin:5px;"> 
<span id="container" style="width: 850px; margin: 0 auto;overflow:scroll"></span>
</div>

我刚刚删除了溢出属性,它工作正常,我的 html 变成了这样:

   <div style="border: 1px solid #ccc; padding:10px; margin:5px;"> 
<span id="container" style="width: 850px; margin: 0 auto;"></span>
</div>

关于javascript - Highcharts 错误 #19,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25238475/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com