orbit-basic/app/views/admin/dashboards/_traffic_loading.erb

34 lines
1.2 KiB
Plaintext

<div class="box-header">
<h2>
<i class="icons-book-2"></i>
<span class="break"></span>
<%= t(:monthly_traffic)%>
</h2>
</div>
<div class="box-content">
<div id="month_traffic" style="min-width: 310px; margin: 0 auto">
<%= line_chart get_month_traffic, :height => "200px", :name => 'Visit',
:library => {
legend: 'none',
chartArea:{ width: '95%', left: 50, right: 0},
hAxis:{format:'MMM-d',gridlines:{color: '#CCC', count: 31}},
vAxis:{minValue:-100,viewWindowMode: 'maximized'}
} %>
</div>
</div>
<script type="text/javascript">
renderLineChart = function (element, series, opts) {
waitForLoaded(function () {
var options = jsOptions(series, opts);
var data = createDataTable(series, "datetime");
var formatter = new google.visualization.DateFormat({
pattern: options.pattern
});
formatter.format(data, 0);
var chart = new google.visualization.LineChart(element);
resize(function () {
chart.draw(data, options);
});
});
};
</script>