0
我也要制定出一個內部網絡上隨時間的DNS查詢的圖表,爲我用Highstock你可以波紋管看到:Diplay名
我需要的是要在工具提示上顯示DNS的名稱,DNS名稱和匹配將存儲到數據庫中。
代碼的完整性:
<script type="text/javascript" charset="utf-8">
$(function() {
new Highcharts.StockChart({
chart: {
renderTo: 'dns_chart',
type: 'column',
},
title: {
text: 'DNS Hits by Sentinel Controller'
},
scrollbar: {
enabled: true
},
rangeSelector: {
buttons: [
{type: 'hour',count: 1,text: '1h'},
{type: 'day',count: 1,text: '1d'},
{type: 'day',count: 3,text: '3d'},
{type: 'day',count: 7,text: '1w'},
{type: 'day',count: 14,text: '2w'},
{type: 'month',count: 1,text: '1m'},
{type: 'year',count: 1,text: '1y'},
{type: 'all',text: 'all'}
],
selected : 7
},
yAxis: {
title: {text: 'Hits'}
},
xAxis: {
title: { text: 'Domain name'}
},
tooltip: {
crosshairs: [true,true],
shared : true,
pointFormat: '{series.name}: <b>{point.y} hits</b>'
},
legend: {
enabled: true
},
series: [{
name : 'DNS hits',
dataGrouping : {
enabled : false
},
data: ([
<% @HighStock_result.each{ |row| %>
[Date.UTC(<%=row['qt']%>),<%=row['hits']%>],
<%}%>
]),
dataGrouping: {
approximation: "sum",
enabled: true,
forced: true,
units: [['millisecond',[500]]],
}
}]
});
});
</script>
謝謝。