Amend xaxis mode to time from category to try to reduce x axis clutter

This commit is contained in:
perryharlock
2013-11-25 16:19:01 +00:00
parent 7c2647653d
commit 9383de3410
5 changed files with 13 additions and 7 deletions

View File

@@ -76,7 +76,7 @@ module.exports = function (grunt) {
'public/js/vendor/bootstrap/js/dropdown.js',
'public/js/vendor/bootstrap/js/tooltip.js',
'public/js/vendor/flot/jquery.flot.js',
'public/js/vendor/flot/jquery.flot.categories.js',
'public/js/vendor/flot/jquery.flot.time.js',
'public/js/vendor/flot/jquery.flot.selection.js',
'public/js/vendor/flot/jquery.flot.resize.js',
'public/js/site.js'

View File

@@ -17,8 +17,9 @@ $(document).ready(function(){
hoverable: true
},
xaxis: {
mode: 'categories',
tickLength: 0
mode: 'time',
tickLength: 0,
timeformat: "%d %b"
},
yaxis: {
tickDecimals: 0
@@ -115,7 +116,7 @@ $(document).ready(function(){
}
function getXAxisLabel (el) {
return el.find('[data-role="category"]').html();
return el.find('[data-role="category"]').attr('data-value');
}
function storeDatum (el, label) {

File diff suppressed because one or more lines are too long

View File

@@ -17,4 +17,9 @@ function helper (register) {
return moment(context).fromNow();
});
register('date-timestamp', function (context) {
return moment(context).valueOf();
});
}

View File

@@ -23,7 +23,7 @@
<tbody>
{{#results}}
<tr data-role="url-stats">
<td data-role="category">{{date-format date format="DD MMM YYYY"}}</td>
<td data-value="{{date-timestamp date}}" data-role="category">{{date-format date format="DD MMM YYYY"}}</td>
<td class="text-center" data-label="error">{{count.error}}</td>
<td class="text-center" data-label="warning">{{count.warning}}</td>
<td class="text-center" data-label="notice">{{count.notice}}</td>