ruby on rails - How to set the hAxis interval with Google Visualization -


i have used google visualization display chart, when multiple rows of data-table makes chart looks messy, how can set horizontal axis interval when there many columns of data?

example: have range of horizontal axis each month want set horizontal axis range in every 3 months.

you can use d3 time intervals generate clean ticks on google chart.

d3.time.intervals generate list can pass in haxis.ticks option.

for example:

ticks = d3.time.months(     new date(2013, 5, 1),  // start     new date(2014, 2, 1),  // stop     3)                     // step  // set chart options var options = {     title: 'your data',     width: 400,     height: 300,     haxis: {ticks: ticks} }; 

http://jsfiddle.net/s7etx/2/

graph 3-monthly ticks


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -