admin管理员组文章数量:1290976
I'm using NVD3's lineChart model.
I need to force-set the min and max y-axis values relative to the actual ones, e.g.:
chart.lines.forceY([min/1.1,max*1.1]);
How can I get the current min/max y-axis values?
I'm using NVD3's lineChart model.
I need to force-set the min and max y-axis values relative to the actual ones, e.g.:
chart.lines.forceY([min/1.1,max*1.1]);
How can I get the current min/max y-axis values?
Share Improve this question asked Nov 20, 2013 at 9:03 gipadmgipadm 5437 silver badges17 bronze badges2 Answers
Reset to default 5You can get the current domain through chart.yAxis.scale().domain()
.
If you have already set the y-axis domain like so:
var yAxis = d3.svg.axis().scale(y)
.orient("left").ticks(5);
y.domain([0, d3.max(yourData)]);
you can access the values through y
. y[0]
is the minimum, y[1]
is the max.
本文标签: javascriptd3js nvd3jsGet yaxis minmax valuesStack Overflow
版权声明:本文标题:javascript - d3.js nvd3.js — Get y-axis minmax values - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741508935a2382490.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论