1

I'm using d3.js to show bar graph in my application. For limited data(eg: data for 12 days) the graph looks good but when the data value increases (eg: data for 1month or 1year), x-axis values get overwrite onto one another as shown in below image.

https://i.stack.imgur.com/Lw8JA.png

Data for graph comes from server using JSON for each day. So to scale the data do i need to group the data from server side and use that or should i scale that data using javascript before passing it to d3.js and what should be the range that should be set to scale ?

shahsank3t
  • 252
  • 1
  • 13
  • Take a look at [**this**](http://stackoverflow.com/questions/11654836/how-can-i-define-a-maximal-amount-of-ticks-in-a-d3-svg-axis). You need to specify how many ticks you would like to see; also you can use `nice` along with that; and consider clubbing ranges to reduce number of bars when less space is available. – Vikram Deshmukh Jan 02 '14 at 10:55
  • Check this link http://stackoverflow.com/questions/20688115/d3-js-circle-plotting-does-not-working-properly-while-trying-to-load-after-first I have created the `json` from `server side` calling a `python` file. then i have plotted them from a `js` file, where I have calculated the X-axis and Y-axis dynamically – curiousguy Jan 02 '14 at 11:00

0 Answers0