【发布时间】:2019-07-09 13:31:49
【问题描述】:
我有一个带有两个 Y 轴的图表。两者都是第一个折线图,一切正常。但是当我将它更改为一个 Y 轴项目的柱形图时,图表以不同的方式绘制。似乎缺少一些要点。我有一个用于在“列”和“折线”图表之间切换的按钮。单击按钮后,它会显示不同类型的图形,即使两者的数据相同。这是我的javascript,
$.getJSON('https://api.myjson.com/bins/whjvj', function (dataSeries2) {
$.getJSON('https://api.myjson.com/bins/dfoin', function (dataSeries1) {
$('#container').highcharts('StockChart', {
yAxis: [{
height: 250,
gridLineWidth: 1,
title: {
text: 'series 1',
style: {
color: '#3eca4f',
},
},
},
{
title: {
text: 'series 2',
style: {
color: '#888f94',
},
},
top: 300,
height: 100,
offset: 0,
},
],
series: [{
name: 'Series 1',
yAxis: 0,
type: 'line',
data: dataSeries1,
},
{
data: dataSeries2,
name: 'Series',
type: chartTypeRenew,
yAxis: 1,
},
],
});
});
});
And here is the fiddle of the same
谁能帮我解决这个问题?提前致谢。
【问题讨论】:
标签: javascript charts highcharts