我正在使用 Highcharts,我想在值上绘制垂直线。喜欢;
我怎样才能做到这一点 ?谢谢。
这是我的代码
<script type="text/javascript">
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'area'
},
title: {
text: '<b> </b>'
},
xAxis: {
labels: {
formatter: function() {
return this.value; // clean, unformatted number for year
}
}
},
yAxis: {
labels: {
formatter: function() {
return this.value / 1000 +'k';
}
}
},
tooltip: {
formatter: function() {
return '<b>'+ Highcharts.numberFormat(this.y, 0) +'</b>';
}
},
xAxis: {
categories: [
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
],
plotBands: [{ // visualize the weekend
from: 5.5,
to: 6.5,
color: 'rgba(68, 170, 213, .2)'
}]
},
plotOptions: {
area: {
pointStart: 1,
marker: {
enabled: false,
symbol: 'circle',
radius: 1,
states: {
hover: {
enabled: true
}
}
}
}
},
series: [{
name: 'Visit',
data: [946, 733, 764, 887, 832,1423]
}, {
name: 'Unique',
data: [746, 633, 664, 687,702,1266]
}]
});
});
});
</script>