我想buidl通过highcharts确切这种类型的图。highcharts configuration
请按照链接 - like this graph
我已经建立的东西 - mygraph
但我需要用不同的颜色和x轴标签将显示在悬停填充整个列。
$(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column',
height: 400,
},
plotOptions: {
column: {
stacking: 'normal'
}
},
tooltip: {
//xDateFormat: '%Y-%m-%d',
formatter: function() {
return "Click to see all coverage from - " + Highcharts.dateFormat("%b %d", this.x)
},
positioner: function(boxWidth, boxHeight, point) {
return {
x: point.plotX,
y: point.plotY
};
},
},
xAxis: {
gridLineWidth: 0,
type: 'datetime',
dateTimeLabelFormats: {
day: ' %b %e, %Y'
}
},
yAxis: {
gridLineWidth: 1,
title: {
text: ''
},
labels: {
enabled: true
}
},
legend: {
enabled: false
},
series: [{
data: [50, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
pointStart: Date.UTC(2010, 0, 1),
pointInterval: 24 * 3600 * 1000 // one day
}],
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px; width: 500px"></div>