请检查这个 fiddle - http://jsfiddle.net/kumar4215/kfyajdjq/
我正在使用类似的表格结构来显示信息,任何人都可以帮助我如何设置几个月的标签名称。
这里是示例代码 -
/**
* Create the chart
*/
window.chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
events: {
load: Highcharts.drawTable
},
borderWidth: 2
},
title: {
text: 'Average monthly temperatures'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
title: {
text:'month'
}
},
yAxis: {
title: {
text: 'Temperature (°C)'
}
},
legend: {
y: -300
},
series: [{
name: 'City',
data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
}]
});
谢谢。
最佳答案
这是我制作的 fiddle - http://jsfiddle.net/prashu421/7zck9f1g/
将以下 JS 部分添加到您的代码中,您应该可以开始了 -
renderer.text(
"Month",
cellLeft + cellPadding,
tableTop + (1) * rowHeight - cellPadding
)
.css({
fontWeight: 'bold'
})
.add();
关于javascript - JS Highcharts表格-如何设置类别名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47520964/