Open dennisvang opened 7 years ago
I suggest to use chart.yAxis.axisLabelDistance
nv.addGraph(function() {
var chart = nv.models.lineChart()
.useInteractiveGuideline(true)
;
chart.xAxis
.axisLabel('Time (ms)')
.tickFormat(d3.format(',r'))
;
chart.yAxis
.axisLabel('Voltage (v)')
.axisLabelDistance(40)
.tickFormat(d3.format('.02f'))
;
d3.select('#chart svg')
.datum(data())
.transition().duration(500)
.call(chart)
;
nv.utils.windowResize(chart.update);
return chart;
});
https://stackoverflow.com/questions/17289403/nvd3-discretebarchart-y-axis-label
The Line Chart example on the Live Code part of the website (http://nvd3.org/livecode/index.html#codemirrorNav) has a label for the y-axis, but this label is hidden. I guess one fix would be to set e.g.
nv.models.lineChart().margin({left: 100})
.