Reputation: 11
I just started using nvd3 a short while ago and am now facing a big problem for me with multibar charts: My xAxis data has gaps in between, e.g. [1,2,3,4,9,24,120]. I want these gaps to be displayed in the graph, but nvd3 just displays all bars next to each other, so, that the distance between the bars with the x value 2 and 3 is the same as between those with 9 and 24. Is there any way to change this, so that you can see all the gaps in the data? The code I used is just the same as nvd3s example code.
Thank you very much.
Upvotes: 1
Views: 1074
Reputation: 2062
Sure there is. You will fill in 0 for all the missing values. For each y that will correspond to a missing value you will set x = 0. That's all you need to do (it's not as simple as it sounds since there can be cases with series which have no data and so on, but this is the main trick).
Upvotes: 2