使用flag
调试运行
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>图形展示</title>
</head>
<body>
<div class="detail-section">
<div id="canvas">
</div>
</div>
<script src="http://g.tbcdn.cn/bui/acharts/1.0.32/acharts-min.js"></script>
<!-- https://g.alicdn.com/bui/acharts/1.0.29/acharts-min.js -->
<script type="text/javascript">
var chart = new AChart({
theme : AChart.Theme.SmoothBase,
id : 'canvas',
width : 950,
height : 500,
plotCfg : {
margin : [50,50,80] //画板的边距
},
xAxis : {
categories : ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']
},
tooltip : {
valueSuffix : '°C'
},
seriesOptions: {
},
series : [{
id: 's1',
type: 'line',
name: 'Tokyo',
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]
}, {
type: 'line',
name: 'Beijing',
data: [13.9, 14.2, 15.7, 18.5, 21.9, 25.2, 27.0, 26.6, 24.2, 20.3, 16.6, 14.8]
},{
name: 'flag',
data:[{
x : '一月'
},{
x : '一月'
},{
x : '十一月'
},{
x : '十二月'
}],
type: 'flag',
onSeries: 's1' //定义flag坐落的series,不存在则坐落在x轴上面
}]
});
chart.render();
</script>
</body>
</html>