- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当没有值时,是否可以防止 flot 在 y 轴上显示 -1?
提前致谢。
<小时/>//编辑:我正在为某些服务器创建统计图表(每小时访问次数)。有些服务器一天没有访问,所以流程图上没有数据。
用于创建流程图的 JavaScript:
function onOutboundReceived(data) {
var length = data.length;
var finalData = data;
var options = {
series: {
lines: {
show: true,
lineWidth: 2,
fill: true,
fillColor: {
colors: [{
opacity: 0.2
},{
opacity: 0.01
}]
}
},
points: {
show: true
},
shadowSize: 2
},
legend:{
show: false
},
grid: {
labelMargin: 10,
axisMargin: 500,
hoverable: true,
clickable: true,
tickColor: "rgba(255,255,255,0.22)",
borderWidth: 0
},
yaxis: {
ticks: 5,
tickDecimals: 0
},
xaxis: {
ticks: 24,
tickDecimals: 0
}
};
$.plot($("#stats-"+HSIDarr[i]), finalData, options);
最佳答案
根据 API doc ,您可以为 axis
指定 min
和 max
属性:
The options "min"/"max" are the precise minimum/maximum value on the scale. If you don't specify either of them, a value will automatically be chosen based on the minimum/maximum data values.
这样做的示例是在绘图初始化中:
$.plot($("#placeholder"), [ [[0, 0], [1, 1]] ], { yaxis: { max: 1 } });
这是演示 min
和 max
值的代码片段。
$.plot($("#graph"), [ [[0, 0], [1, 1]] ], { yaxis: { max: 1, min: 1 } });
#graph {
width: 600px;
height: 300px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.js"></script>
<div id="graph" style="width:600px;height:300px"></div>
关于jQuery flot - 当没有值时,不在 yaxis 上显示 -1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32010505/
我正在使用 Gunicorn 为 Django 应用程序提供服务,它工作正常,直到我将其超时时间从 30 秒更改为 900000 秒,我不得不这样做,因为我有一个用例需要上传和处理一个巨大的文件(过程
我有一个带有非常基本的管道的Jenkinsfile,它可以旋转docker容器: pipeline { agent { dockerfile { args '-u root' } } stag
在学习 MEAN 堆栈的过程中,我遇到了一个问题。每当我尝试使用 Passport 验证方法时,它都不会返回任何响应。我总是收到“localhost没有发送任何数据。ERR_EMPTY_RESPONS
在当今的大多数企业堆栈中,数据库是我们存储所有秘密的地方。它是安全屋,是待命室,也是用于存储可能非常私密或极具价值的物品的集散地。对于依赖它的数据库管理员、程序员和DevOps团队来说,保护它免受所
是否可以创建像图片上那样的边框?只需使用 css 边框属性。最终结果将是没 Angular 盒子。我不想添加额外的 html 元素。我只想为每个 li 元素添加 css 边框信息。 假设这是一个 ul
我是一名优秀的程序员,十分优秀!