gpt4 book ai didi

javascript - 沿 y 轴的水平线 d3 条形图

转载 作者:行者123 更新时间:2023-11-29 23:30:12 25 4
gpt4 key购买 nike

https://jsfiddle.net/betasquirrel/pnyn7vzj/1/在这个 plunkr 中,如何添加沿 y 轴的水平线

我刚刚尝试添加此 css 代码

  .axis path,
.axis line {
fill: none;
stroke: #000;
}

我想开发没有 x 轴的条形图,我附上了一张图片,请检查一下。 enter image description here

最佳答案

在您的代码中,您定义xAxis 的位置。而不是:

var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom")
.tickFormat(d3.time.format("%Y"));

你应该尝试:

var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom")
.tickValues([]);

这将删除您的 x 轴标签和刻度。阅读this发布以获取更多信息。

关于javascript - 沿 y 轴的水平线 d3 条形图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47633723/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com