javascript - Rickshaw only show gridlines on some points -


i have graph made rickshaw:

my graph

i have tick marks setup have label if value -24, 0, or 24:

// instantiate x-axis var xaxis = new rickshaw.graph.axis.x({   graph: graph,   orientation: 'bottom',   pixelspertick: 25,   element: graphxaxis,   tickformat: function(n) {     switch(n) {       case -24: return '24 hours ago';       case 0: return 'now';       case 23: return '24 hours now';     }   } }); 

but gridlines show on every single tick, ones case statement doesn't return for! how can rid of rest of gridlines?

you can specify desired number of ticks ticks key. not give specific control on ticks generated , may not number requested. additional extension rickshaw can gain more control on ticks, detailed supporting code here.

var xaxis = new rickshaw.graph.axis.x({   graph: graph,   orientation: 'bottom',   pixelspertick: 25,   ticks:3,   element: graphxaxis,   tickformat: function(n) {     switch(n) {       case -24: return '24 hours ago';       case 0: return 'now';       case 23: return '24 hours now';     }   } }); 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -