Reputation: 157
Here is my working DEMO.
I have two problems here:
datajson
, chart doesn't fit to the current window. Therefore, I can't see all of the researcher names in that case. I would appreciate any help.
Thanks
Upvotes: 0
Views: 49
Reputation: 2346
First part
You can use the .ticks
function to specify number of values in your axis :
var xAxis = d3.svg.axis()
.scale(x)
.orient("top")
.ticks(end_year-start_year);
Second part
You can make a dynamic height for your graph like this :
var margin = {top: 20, right: 200, bottom: 0, left: 20},
width = 300,
height = datajson.length * 20 + margin.top + margin.bottom;
Maybe, you just have to adapt the item height value
Upvotes: 1