I'm trying to add axis labels to a NVD3 Multi-Bar Chart, but it only seems to work for the x axis. Is there any way around this?
I have set up an example here: /
var chart = nv.models.multiBarChart();
chart.xAxis
.tickFormat(d3.format(',f'));
chart.yAxis
.tickFormat(d3.format(',.1f'));
chart.xAxis.axisLabel("x axis");
chart.yAxis.axisLabel("y axis");
I'm trying to add axis labels to a NVD3 Multi-Bar Chart, but it only seems to work for the x axis. Is there any way around this?
I have set up an example here: http://jsfiddle/msts1jha/2/
var chart = nv.models.multiBarChart();
chart.xAxis
.tickFormat(d3.format(',f'));
chart.yAxis
.tickFormat(d3.format(',.1f'));
chart.xAxis.axisLabel("x axis");
chart.yAxis.axisLabel("y axis");
Share
Improve this question
asked Oct 12, 2014 at 14:57
user3170702user3170702
2,0618 gold badges27 silver badges33 bronze badges
1 Answer
Reset to default 6Your yAxis
is hidden, set the left margin on your chart, and it will work.
Try this :
var chart = nv.models.multiBarChart().margin({left: 100});
More info regarding margins have a look here
Hope it helps
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744321686a4568448.html
评论列表(0条)