duckworthd
duckworthd

Reputation: 15207

giving axis ticks more space in nvd3

I am constructing a horizontal bar plot in nvd3 with domain names as x-labels. The domain names, while not too long, are longer than the amount of space given to them. How do I increase the amount of space given to an axis in nvd3?

jsfiddle example here.

enter image description here

Upvotes: 1

Views: 2184

Answers (1)

icanc
icanc

Reputation: 3577

Apparently, you can specify your own margins. For example:

var chart = nv.models.multiBarHorizontalChart()
    .margin({top: 30, right: 10, bottom: 30, left: 90}) // increase the left margin
    .x(function(d) { return d[0]; })
    .y(function(d) { return d[1]; });

Here is the updated fidle.

Upvotes: 4

Related Questions