更改一个y轴的范围nvd3 / d3 [英] Change range for one y axis nvd3/d3

查看:213
本文介绍了更改一个y轴的范围nvd3 / d3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用multiChart模型,我有两个不同的y轴。我想改变两个轴,使它们从0开始,因为它们从最小的y数据点开始。



我试过做下面的事情: / p>

  chart.yAxis1 
tickFormat(d3.format(',。f'))
.domain [0,max_y]);

但似乎无效



  .forceY([0,max_y])

它告诉我没有forceY函数



任何想法?



<$ p $

p> chart.bars.forceY([0]);

chart.lines.forceY([0,100]);


I am currently using the multiChart model and I have two different y Axes. I would like to like to change both of the axes so that they start at 0 because currently they start at the smallest y data point.

I have tried doing the following

chart.yAxis1
tickFormat(d3.format(',.f'))
.domain([0,max_y]);

but that doesnt seem to work

and

.forceY ([0, max_y])

it tells me that there is no forceY function

Any ideas?

解决方案

You can force min and max values in NVD3 for line or bar charts, try as below:

chart.bars.forceY([0]);

chart.lines.forceY([0,100]);

这篇关于更改一个y轴的范围nvd3 / d3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆