高图-多轴图形不显示标签
Highcharts - Multiple Axis Graph not displaying labels
我正在尝试使用Highcharts库创建一个多轴图表。我可以让情感轴正确地显示它的标签,但响应数(适用)轴不显示任何文本标签。
我使用的代码是:
$(document).ready(function(e) {
var perShapeGradient = {
x1: 0,
y1: 0,
x2: 0,
y2: 1
};
chart = new Highcharts.Chart({
chart: {
renderTo: 'GraphContainer',
height: 275,
marginTop: 30
},
colors:
[
{
linearGradient: perShapeGradient,
stops:
[
[0, 'rgba(186, 186, 186, 1)'],
[1, 'rgba(232, 232, 232, 0.8)']
]
}
],
title: {
text: null
},
plotOptions: {
line: {
lineWidth: 1,
marker: {
radius: 6,
fillColor: '#fff',
lineColor: '#e10019',
lineWidth: 1.5,
states:
{
hover:
{
radius: 8,
fillColor: '#e10019',
lineColor: '#fff',
lineWidth: 2
}
}
}
}
},
xAxis: {
categories: ['13 May', '20 May'],
title: 'Week Commencing'
},
yAxis: [{
labels: {
endOnTick: true,
formatter: function() {
return this.value + '%';
},
style: {
color: '#e10019',
fontSize: 10
}
},
title: {
text: '% rated as 4 or 5',
rotation: 270,
offset: 75,
style: {
color: '#f49fa8',
fontSize: 11,
fontWeight: 'normal'
}
},
max: 100,
opposite: true
}, {
gridLineWidth: 0,
title: {
text: 'Number of responses',
style: {
color: '#888',
fontSize: 11,
fontWeight: 'normal'
}
},
labels: {
formatter: function()
{
x = this.value.toString();
var pattern = /(-?'d+)('d{3})/;
while (pattern.test(x))
x = x.replace(pattern, "$1,$2");
return x;
},
style: {
color: '#888',
fontSize: 10
}
}
}],
tooltip: {
formatter: function() {
var unit = {
'Applicable': '',
'Sentiment': '%'
}[this.series.name];
return 'Week Commencing ' + this.x +': '+ this.y +' '+ unit;
}
},
legend: {
enabled: false
},
series: [{
name: 'Applicable',
type: 'column',
data: [307, 200]
}, {
color: '#e10019',
name: 'Sentiment',
type: 'line',
data: [44.3, 20]
}]
});
});
我还创建了一个JS提琴:http://jsfiddle.net/9MrYd/1/
它不显示任何值,因为没有为yAxis设置linked
参数或没有系列链接到该yAxis。您需要为第一或第二系列设置yAxis
参数
或使用linkedTo参数:
http://jsfiddle.net/9MrYd/5/http://api.highcharts.com/highcharts yAxis.linkedTohttp://api.highcharts.com/highcharts series.yAxis
相关文章:
- 在高图表中,每x步只显示标签
- 如何隐藏和显示标签控件JavaScript
- 如何在angular js的ng应用程序中以普通的htm显示标签
- 使用细丝组tablesaw插件时未显示标签
- 用Javascript在具有相同类的按钮上显示标签
- Dijit 按钮显示图标,但不以编程方式显示标签
- 当圆形图像在圆轮中发生变化时,如何在顶部显示标签
- jqPlot - 无法使 x 轴正确显示标签
- 在堆叠条形图上显示标签
- 在酒窝气泡图中的每个气泡内显示标签
- Struts2 显示标签动态链接显示相同的行值
- HTML,显示标签的输入值
- JS sup() 在 html 中显示标签
- 如何在我的WinJS工具栏上显示标签
- d3图表宽度不会在x轴上显示标签
- 如何在鼠标悬停在条形图上时显示标签
- Select2.js-如何防止显示标签
- 我无法在JQChart中显示标签
- 使用 jQuery 验证并尝试在标签无效时突出显示标签
- 将鼠标悬停在圆上时显示标签