我可以将ElasticX(),Elasticy()仅适用于上限,DC.JS吗?

发布于 2025-02-13 01:17:31 字数 278 浏览 2 评论 0原文

我在DC.JS中有一个BubbleChart,该在X轴上有依据。计数不能为负,但是上限是未知的。我希望我的X轴始终从0开始,但会自动将上限调整为我正在查看的范围。如果我使用.elasticx(true),则上限会按照我的意愿自动调整,但是下限也向上移动,请参见下面。是否有一种简单的方法使上限是弹性的,但是下限从0开始?

“在此处输入图像说明”

I have a bubbleChart in dc.js which has a count on the x-axis. The count cannot be negative, but the upper bound is unknown. I would like my x-axis to always start at 0, but automatically adjust the upper bound to the range I am looking at. If I use .elasticX(true), the upper bound is adjusted automatically as I want it to be, but the lower bound also moves up, see below. Is there an easy way to have the upper bound be elastic, but the lower bound to start at 0?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

错々过的事 2025-02-20 01:17:31

直接支持这将是很棒的;现在,没有内置的东西可以支持这一点。

但是,看起来您可以覆盖Xaxisminyaxismin将它们迫使它们归零。类似:

chart.xAxisMin = function() { return 0; };
chart.yAxisMin = function() { return 0; };

请让我知道这是否对您有用。这确实应该是图表中的一个选择。

It would be great to support this directly; right now there is nothing built in to support this.

However it looks like you can override xAxisMin and yAxisMin to force them to zero. Something like:

chart.xAxisMin = function() { return 0; };
chart.yAxisMin = function() { return 0; };

Please let me know if this works for you. It really should be an option in the charts.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文