我有一个网站,多年来我一直使用 highcharts,没有出现任何问题。原始版本是4.2.0。
我尝试通过直接从 highcharts 网站下载来更新到版本 5.0.7。然后,我替换了相应的脚本标签以反射(reflect)更改。然而,经过这一更改,我只在图表应有的位置出现了一个黑框。
这就是 highchart 的初始化方式:
Highcharts.chart('container', {
chart: {
type: 'column',
backgroundColor: null
},
title: {
text: 'Resumen Comparativo Inter-Zonas País (' + meses[periodo % 100 - 1] + '-' + Math.floor(periodo / 100) + ')',
style: {
"fontSize": "14px"
}
},
credits: {
enabled: false
},
xAxis: {
categories: zonas
},
yAxis: [{
min: 0,
title: {
text: 'Totales por Zonas y País'
}
}, {
min: -1000000000,
title: {
text: 'No Encontrados',
style: {
color: '#B2455E'
}
},
labels: {
style: {
color: '#B2455E'
}
},
opposite: true,
reversed: false
}],
tooltip: {
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>',
shared: true
},
plotOptions: {
column: {
stacking: 'normal'
}
},
series: [{
name: 'Repetidos',
type: 'column',
data: getMontosPorCondicion(inventarios, 'REPETIDO', null)
}, {
name: 'Resellados',
type: 'column',
data: getMontosPorCondicion(inventarios, 'RESELLADO', null)
}, {
name: 'Abiertos',
type: 'column',
data: getMontosPorCondicion(inventarios, 'ABIERTO', '#8BBC22')
}, {
color: '#B2455E',
name: 'No Encontrados',
type: 'spline',
yAxis: 1,
marker: {
fillColor: '#FFFFFF',
lineColor: null,
lineWidth: 2
},
data: getMontosPorCondicion(inventarios, 'NO ENCONTRADO', '#B2455E')
}]
});
有什么帮助吗?
最佳答案
您的 highcharts.js 副本可能与 cdn https://code.highcharts.com/highcharts.js 不同。将副本中的代码替换为 cdn 的代码。这应该可以正常工作。
关于javascript - hightcharts从4.2.0升级到5.0.7后仅显示黑框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42075822/