javascript - 为 highcharts 中的列组图设置背景颜色
问题描述
我在 highchart JavaScript 库中有一个用于 4 个不同数据的列组图表。我想每个月为每个特定数据设置背景颜色,但不幸的是,我没有找到任何可以为我呈现它的相关代码。如果你能帮助我,我会非常高兴。
解决方案
我认为使用plotBands功能可能是您的情况的一个很好的解决方案。
演示:https ://jsfiddle.net/BlackLabel/ta9L4zfx/
xAxis: {
plotBands: [{
from: -0.35,
to: 0.35,
color: 'gray'
}, {
from: 0.65,
to: 1.35,
color: 'gray'
}, {
from: 1.65,
to: 2.35,
color: 'gray'
}]
},
API:https ://api.highcharts.com/highcharts/xAxis.plotBands.events
推荐阅读
- javascript - 将数据打印到 HTML 模板的最佳方式?
- java - Google Drive API v2 - 如果enforceSingleParent 未设置为TRUE,单父模型实施是否存在问题?
- bixby - 如何获取当前位置的详细街道名称?
- node.js - 在 node.js 中使用 DEBUG=express:* npm start 命令时发生错误
- sql - 为什么我在插入时不断收到语法错误(MS Access 2013)
- node.js - 如何在本地模拟 Heroku react 应用程序构建?
- javascript - 使用 Map 将数据从父组件传递到子组件时出现 Angular ExpressionChangedAfterItHasBeenCheckedError
- android - 为什么 Calendar.getDisplayName 在给定毫秒时总是返回一周中的同一天?
- python - 如何检查是否可以从列表中的字母创建单词?
- html - 如何在表格标签上添加边框?