我使用的是 Highcharts 1.7,对于这个重复的标签(左边的那个,0.025),一切都工作得很好,但在我需要的实际 Highcharts 版本中,标签被渲染了 3 次。不知道这里出了什么问题。 所以基本上> Highcharts 多次重复 0.25 文本。 请参阅此链接以获取代码和工作示例。 http://jsfiddle.net/pCuUW/
$(function() {
var chart;
$(document).ready(function() {
var chart = new Highcharts.Chart({
'chart': {
'renderTo': 'container',
'type': 'bar',
'width': 500,
'height': 150
},
'exporting': {
'enabled': false
},
'yAxis': {
'max': 1400,
'title': {
'text': ''
}
},
'title': {
'text': 'My normal barchart'
},
'plotOptions': {
'bar': {
'pointWidth': 30,
'borderWidth': 0,
'dataLabels': {
'enabled': true,
'distance': -10,
'color': 'black',
'padding': 5,
'x': -45,
'backgroundColor': '#ffffff',
'borderWidth': 1,
'borderColor': '#000000',
'style': {
'fontSize': '12px',
'font-weight': 'bold'
},
}
}
},
'credits': {
'enabled': false
},
'labels': {
'enabled': false
},
'legend': {
'enabled': false
},
'series': [{
'data': [637]}]
});
});
});
这里出了什么问题?预先感谢您的帮助。
最佳答案
这很可能是因为您没有在x 轴中提到类别。
尝试添加这个
xAxis: {
categories: ['Cost'], // just a default value
title: {
text: null
}
},
关于javascript - Highcharts 创建相同文本 3 次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13185901/