- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Plnkr 示例: http://plnkr.co/edit/19D5cnrVYdUrMlblQARy?p=preview
我尝试修改 CSS,但是我只能删除第二条(右 Y 轴线),但不能删除第一条左 Y 轴线。
我尝试过的:
.nv-y {
display: none;
}
以及此答案中的所有行:Alter first vertical grid line in nvd3
d3.selectAll('.nv-y').attr('display','none')
d3.selectAll('.nv-y path').attr('opacity','0.1')
d3.selectAll('.nv-y path').attr('display','none')
我当前的drawChart函数:
function drawChart(res) {
console.log(' ');
console.log('drawChart res = ',res);
nv.addGraph(function() {
var chart = nv.models.linePlusBarChart()
.margin({top: 30, right: 40, bottom: 50, left: 40})
.x(function(d,i) { return i })
.y(function(d) { return d[1] })
.color(d3.scale.category10().range());
chart.xAxis.tickFormat(function(d) {
var dx = res[0].values[d] && res[0].values[d][0] || 0;
return d3.time.format('%x')(new Date(dx))
});
chart.y1Axis
.tickFormat(d3.format(',f'));
chart.y2Axis
.tickFormat(function(d) { return '$' + d3.format(',f')(d) });
chart.bars.forceY([0]);
// https://stackoverflow.com/questions/23754188/nvd3-js-how-to-disable-tooltips-for-one-serie-only
chart.lines.interactive(false);
// http://nvd3-community.github.io/nvd3/examples/documentation.html#line
chart.height(280);
// If not chart data is avaliable to display:
chart.noData("There is no Data to display at the moment.");
// Remove legend:
chart.showLegend(false);
d3.select('#chart svg')
.datum(res)
.transition().duration(500)
.call(chart);
d3.selectAll('.nv-y path').attr('display','none');
nv.utils.windowResize(chart.update);
return chart;
});
}
最佳答案
如果你想隐藏第一个 y 轴,请执行以下操作:
.nv-y1{
display:none;
}
如果你想隐藏第二个 y 轴,请执行以下操作:
.nv-y2{
display:none;
}
关于javascript - 如何隐藏 nvd3 图表上的第一条 Y 轴线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32852062/
[INFO] [INFO] --- dependency-check-maven:4.0.2:check (default) @ realtimePaymachine --- [INFO] Centr
我开始从 NVD XML 提要转向 JSON 提要(因为从 2019 年 10 月起不再支持 XML)。现在我很难理解这些标签及其使用目的。 例如: “配置”中的“运算符(operator)”标签有什
我的 IT 产品已定义 CPE,例如:cpe:/o:microsoft:windows_vista:6.0:sp1:~-~home_premium~-~x64~- 我正在使用 NVD 数据源来获取所有
我们正在使用 jQuery,我在国家漏洞数据库中发现了以下 jQuery 漏洞: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-23
我正在尝试下载 NVD CVE。这是我的Python代码: import requests import re r = requests.get('https://nvd.nist.gov/vuln/
目前我正在使用 Angular-nvd3 图形来显示数据。但是,堆叠面积图 nvd3 图形类型正在切断数字和轴标签。模板图可查看here 。 y 轴数字和标签是主要关注点。下面是图形选项代码和问题的图
我们在项目中遇到以下错误,该URL何时返回? > Task :dependencyCheckAnalyze Verifying dependencies for project cckm-app
我在gitlab管道中使用gradle:5.6.2-jdk8 docker镜像。 gradle clean build 上面的命令因错误而失败: 无法下载元文件:https://nvd.nist.go
我是一名优秀的程序员,十分优秀!