- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Highcharts 构建一个量表。
我无法实现的部分是针接触到粉红色的外弧。改变数字 8 的字体大小(它应该以更大的字体显示 8%),在圆弧的右端打印 100%,并在 guage 的中心显示一些文本。
我尽力解决了这些问题,但没有成功。我感谢有关如何前进的任何建议。提前致谢!
http://jsfiddle.net/q5hgky25/1/
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/solid-gauge.src.js"></script>
<div id="business-metrics-guage"></div>
$(function() {
$('#business-metrics-guage').highcharts({
chart: {
type: 'solidgauge',
spacingTop: 0,
spacingRight: 0,
spacingBottom: 0,
spacingLeft: 0,
plotBorderWidth: 0,
marginRight: 0,
marginLeft: 0,
marginTop: 0,
marginBottom: 0,
backgroundColor: 'none'
},
tooltip: {
enabled: false
},
title: {
text: 'Test'
},
credits: {
enabled: false
},
pane: {
size: '140%',
startAngle: -90,
endAngle: 90,
background: {
innerRadius: '42%',
outerRadius: '41%',
backgroundColor: '#000',
shape: 'arc'
}
},
plotOptions: {
solidgauge: {
dataLabels: {
enabled: false
}
}
},
yAxis: {
labels: {
enabled: true,
x: 10,
y: -10
},
//tickPositions: [80, 90],
min: 0,
max: 50,
gridLineColor: 'transparent',
lineColor: 'transparent',
minorTickLength: 0,
tickInterval: 67,
tickPositions: [8], //8%
tickColor: '#000000',
tickPosition: 'inside',
tickLength: 50,
tickWidth: 2
},
series: [{
data: [{
y: 8,
color: '#f95d6f'
}], //y 8%
dataLabels: [{
useHTML: true,
format: '<div style="text-align:center">Total here</div>'
}],
radius: '45%'
}]
});
});
最佳答案
首先,您的问题中有四个问题,您应该在不同的问题中提出每个问题。
无论如何,为了让针接触粉红色的外弧,您可以使用 plotOptions.solidgauge.innerRadius
并更改 pane
和它的背景半径以适应您想要的输出:
plotOptions: {
solidgauge: {
innerRadius: '75%'
}
}
对于标签的字体大小及其 %
后缀,使用 yAxis.labels.format
和style.fontSize
:
yAxis: {
labels: {
enabled: true,
x: 10, y: -10,
format: '{value} %',
style: {
fontSize: 16
}
}
}
要在右端显示 100 %
,将 100 添加到 yAxis 的 tickPositions
:
tickPositions: [8, 100]
对于居中的一些文字,可以使用subtitle
:
subtitle: {
text: 'Total here'
}
这是 DEMO .
关于javascript - 使用 Highcharts 获取 Solid Guage 的刻度位置和标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30267507/
我想知道大括号在那种情况下是什么意思? uint64 configCount = s_configCount; { s_hotVars.latestConfigDigest = c
我正在运行一个独立的单用户 v5 节点实体服务器。当我以该单个用户身份登录时,我能够在一个不存在的容器中创建一个文档,并且服务器会为我创建该容器。 例如 POST https://my.server:
我想覆盖以下继承函数: function _setBaseURI(string memory baseURI) public override(ERC721Full, ERC721Metadata
我定义了一个映射类型的状态变量,例如映射(uint256 => uint256[])。我想将其公开,以便我可以从契约(Contract)外部访问它。但是,编译器报告错误 TypeError: Wron
我正在处理 Solidity 智能合约,并且正在导入 openzeppelin-solidity 库和 chainlink 库。 两者都有 SafeMath 库;我正在用 Python 加载所有 .s
我在以下示例中遇到了 Solidity Documentation 并且在我的项目中有类似的代码并想设置 default value如果键不是从调用者传递过来的,则到 key 参数 pragma so
据我所知,有两种方法可以获得某个地址的余额。 address firstAddress; "firstAddress.balance"这将获得地址“firstAddress”的余额。 address
我正在使用 solidity 构建一个 NFT 智能合约,并且我试图在部署合约时将 Array of Structs 传递到构造函数中。但是我收到以下错误。 TypeError: Cannot rea
免费的 Everscale Solidity。如何与负责 职能部门合作?如何正确等待回调并从sdk查看合约执行结果? 例如,我有契约(Contract)(没有任何用处)。如何在我的应用程序中以正确的方
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 3 年前。 Improve
我最近在很多代码中注意到人们将硬编码的配置(如端口号等)值放在类/方法的深处,使其难以找到,也无法配置。 这是否违反了 SOLID 原则?如果不是,我是否可以向我的团队成员引用另一个“原则”来说明为什
Solidity 最近的变化将回退函数格式从只是 function() 更改为 fallback(),这对于初学者来说非常好理解发生了什么,但是我有一个问题,关于编译器在我实现时给我的建议后备。 例如
如果我有类似的东西 class square : figure {} class triangle : figure {} 这是否意味着我永远不应该使用正方形和三角形类而只能引用图形? 永远不要这样做
我正在尝试将字节可靠地转换为 uint256。这是坚固的代码, // SPDX-License-Identifier: MIT pragma solidity 0.8.13; contract Sam
我想在 SolidJS 中动态设置 JSX 标签名称。我来自 React it is fairly simple to do : /* Working ReactJS Code: */ export
我正在尝试将字节可靠地转换为 uint256。这是坚固的代码, // SPDX-License-Identifier: MIT pragma solidity 0.8.13; contract Sam
我想在 SolidJS 中动态设置 JSX 标签名称。我来自 React it is fairly simple to do : /* Working ReactJS Code: */ export
我正在继续开发 ASP.NET 应用程序(基于 Web 表单),其中以前的开发人员没有遵循良好的面向对象设计原则,即 SOLID (http://www.remondo.net/solid-princ
我创建了 ERC20 代币,我想将我的代币转移到另一个地址。 我的元掩码中有两个帐户。(帐户 A/B) 我的 ERC20 代码在这里(我在账户 A 中部署并保存了代币) pragma solidity
struct Test { uint ui; string s; } function test(Test t) public { emit Log(t.ui, t.s); } 我对 AB
我是一名优秀的程序员,十分优秀!