在以下示例中,最后一个标签未按预期显示。有 12 个值对和 12 个标签。我希望最后一个标签是指定的标签,而不是显示索引 12。
http://jsfiddle.net/chrizzl/9eN2C/
或者:
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<div id='chart1994257d6b2b' class='highcharts'></div>
<script type='text/javascript'>
(function($){
$(function () {
var chart = new Highcharts.Chart({
"dom": "chart1994257d6b2b",
"width": 800,
"height": 400,
"yAxis": {"labels": {"enabled": true},"min":0},
"xAxis": {"categories": [ "KW 1", "KW 2", "KW 3", "KW 4", "KW 5", "KW 6", "KW 7", "KW 8", "KW 9", "KW 10", "KW 11", "KW 12" ],
"labels": {"overflow": "justify", "enabled": true,
"rotation": -45,
"y": 20,
"align": "right"
},
"tickmarkPlacement": "on",
"tickInterval": 2
},
"series": [{"data": [
[1,74],[2,60],[3,79],[4,94],[5,90],[6,83],[7,120],[8,90],[9,90],[10,29],[11,70],[12,66 ]],
"type": "line",
"name": "Test"
}],
"id": "chart1994257d6b2b",
"chart": {"renderTo": "chart1994257d6b2b"}
});
});
})(jQuery);