- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法显示下表中数据标签的 targets
变量。出于某种原因,系列数据标签仅显示 targetsAdj
值。我尝试在 y 轴上添加堆叠标签,但没有用。还有什么办法可以做到这一点?
ar targets = [<?php echo $gg[0][24].",".$gg[0][20].",".$gg[0][26].",".$gg[0][22].""; ?>],
mcbf = [ <?php echo $gg[0][16].",".$gg[0][17].",".$gg[0][18].",".$gg[0][19].""; ?>],
targetsAdj = [],
attagg=[],
calc,
calc2;
for (var i=0;i<targets.length;i++) {
calc = targets[i] >= mcbf[i] ? targets[i] - mcbf[i] : 0;
targetsAdj.push(calc);
}
for (var i=0;i<mcbf.length;i++) {
calc2 = (mcbf[i]/targets[i])>=0.7 ? {y:mcbf[i],color:'#1de9b6',borderColor:'#00bfa5'} : ((mcbf[i]/targets[i])>=0.4 ? {y:mcbf[i],color:'#ffeb3b',borderColor:'#fdd835'}:{y:mcbf[i],color:'tomato',borderColor:'#d84315'});
attagg.push(calc2);
}
$('#attivazioni').highcharts(
{
"colors":
["tomato"
, "lime"
, "rgba(139,188,33,.5)"
, "rgba(145,0,0,.5)"
, "rgba(26,173,206,.5)"
, "rgba(73,41,112,.5)"
, "rgba(242,143,67,.5)"
, "rgba(119,161,229,.5)"
, "rgba(196,37,37,.5)"
, "rgba(166,201,106,.5)"],
"chart": {
"zoomType": "x",
"showAxis": true,
"alignTicks": true,
//"height": 300,
"style": {
"fontFamily": "Helvetica, Arial, sans-serif",
"color": "#333"
},
"backgroundColor": "#ffffff"
},
"title": {
"text": " "
},
"xAxis": [{
"tickmarkPlacement": "on",
"labels": {
"style": {
"fontSize": "10px",
"color": "#333"
},
"useHTML": true
},
"gridLineColor": "lightgrey",
"gridLineWidth": 0,
"categories": ["<span style=\"font-size:12px\"><b>Lead</span>"
, "<span style=\"font-size:12px\"><b>Lvc</span>"
, "<span style=\"font-size:12px\"><b>Push</span>"
, "<span style=\"font-size:12px\"><b>AddOn</span>"]
}],
"yAxis": [{
"alternateGridColo": "null",
"minorTickInterval": "auto",
"lineColor": '#000',
"tickWidth": "1",
"tickColor": '#000',
"gridLineColor": "#C0C0C0",
"gridLineWidth": 1,
"lineColor": "#C0C0C0",
"lineWidth": 1,
"endOnTick": true,
"min": 0,
"labels": {
"formatter": function () {
return '%' + this.axis.defaultLabelFormatter.call(this);
} ,
"style": {
"fontSize": "10px",
"color": "black"
}
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
},
formatter: function() {
return Highcharts.numberFormat(this.total, 2, ',');
}
},
title: {
text: '',
style: {
display: 'none'
}
},
subtitle: {
text: '',
style: {
display: 'none'
}
},
}],
"legend": {
"enabled": false
},
"navigation": {
"buttonOptions": {
"enabled": false
}
},
"plotOptions": {
"series": {
"dataLabels": {
"enabled": true,
"style": {
"color": "#333"
},
"crop": false,
"overflow": "none"
},
"shadow": false,
"marker": {
"enabled": false
}
},
"column": {
"grouping": false,
"stacking": "percent",
"shadow": false
}
},
"credits": {
"enabled": false
},
"tooltip": {
"enabled": false,
"shared": true,
"valueDecimals": 0
},
"series": [{
"name": "Target",
"type": "column",
"color": "rgba(140, 131, 131, 0.49)",
"borderColor": "#B0BEC5",
"borderWidth": 2,
"data": targetsAdj,
"dataLabels": {
y:-18,
verticalAlign:'top',
"formatter": function() {
if (this.series.index == 0) return targets[this.point.x];
else return this.y;
}
}
},{
"name": "SELLS",
"type": "column",
"data": attagg,
"color": "#1de9b6",
"borderColor": "grey",
"borderWidth": 2,
"zIndex": 10
} ]
});
最佳答案
我通过将系列数据标签设置为 false 来解决。并将 yaxis 设置更改为:
yAxis: {
min: 0,
max: 105,
endOnTick: false,
title: {
text: null
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: 'black'
}
}
},
关于javascript - 如何使用 highcharts 渲染整体数据标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37021229/
我正在阅读Head First Design Patterns一书,在第382页上说: Composite Patterns is used when you have collection of o
我将我的电脑用作 wifi 热点,并将其他设备连接到它。然后使用wireshark,我可以看到特定设备上发送/接收的数据包,但是我怎样才能看到设备正在查看的完整网页而不是单独的数据包? 最佳答案 尝试
在 URL 中打开我的 Jenkins 时,我似乎无法登录它会抛出消息“用户缺少整体/读取权限”。我试过answer来自类似的问题,但禁用安全性不起作用。 Jenkins 继续抛出错误。有人建议我一起
我已经使用工具分配测试了我的应用程序并得到了这张图片: 如图所示,我的应用程序正常工作,但它通常以总字节数计值吗?我担心“#Allocations (Net/Overall)”,因为它的颜色是红色。这
我遵循教程 Deployment on Tomcat without modification of monitored webapps (beta) .监控站点正在运行,我可以看到统计页面。问题是
所以我有一个 div,其中整个东西都是一个 anchor 标记,我试图控制颜色在悬停时的显示方式并获得不同的结果。希望我能用 CSS 做到这一点。发生的事情是悬停,一个文本发生变化,但另一个没有。但是
我创建了一个程序,您可以在其中输入行驶的英里数和每 jar 油使用的加仑数,该程序会显示每 jar 油的 mpg。我使用的是 Visual Studio 2010。当我输入标记值 -1 时,系统会给出
我有一个由 N 个节点组成的 zookeeper 集群(彼此了解)。如果我在 zk 客户端连接字符串中只传递 M < N 个节点地址怎么办?集群的行为是什么? 在更具体的情况下,如果我只从集群中传递
我一直在试图弄清楚当使用诸如 pushViewController:animated、presentModalViewController:animated 和 UITabBarViewControl
我已经在 VIM 中安装了 minikube,并且我拥有具有所有权限的服务帐户 token 。是否有来自 kubernetes 的 API 来获取资源使用情况(总体)。 最佳答案 要获取 CPU 和内
如何通过 HTTP 客户端(例如 CURL、Insomnia、Postman 等)快速使用使用 JWT token 的 JHipster 生成的应用程序? 最佳答案 嗯,我研究了一段时间,发现你必须遵
我是一名优秀的程序员,十分优秀!