javascript - Highcharts:仅渲染百分比条使用类型:'xrange'
问题描述
想要在没有 Toolchip、标题、xAxis 等的情况下渲染百分比条。
应该使用 x 范围吗?
https://www.highcharts.com/docs/chart-and-series-types/x-range-series
解决方案
是的,您应该使用x-range
系列类型。我准备了一个简单的例子:
Highcharts.chart('container', {
chart: {
type: 'xrange',
width: 200,
height: 50,
spacing: [0, 0, 0, 0]
},
credits: {
enabled: false
},
title: {
text: ''
},
xAxis: {
type: 'datetime',
visible: false
},
yAxis: {
visible: false,
title: {
text: ''
},
type: 'category'
},
legend: {
enabled: false
},
tooltip: {
enabled: false
},
series: [{
name: 'Project 1',
pointPadding: 0,
groupPadding: 0,
borderColor: 'gray',
data: [{
x: Date.UTC(2014, 10, 21),
x2: Date.UTC(2014, 11, 2),
y: 0,
partialFill: 0.25
}],
dataLabels: {
enabled: true
}
}]
});
推荐阅读
- c++ - 使用 memoization 在 C++ 中实现 Knapstack
- python - 将命名元组列表附加到另一个元组
- java - Java - 通用 Drools 规则
- c - 如何在一个位置将数组元素向右移动?C语言
- javascript - 如何在 javascript 中使用正则表达式替换字符串 '&user_story=x' 的所有实例?
- .htaccess - 重定向定位到旧网址的开头和结尾
- python - z3py push 后模型错误但没有正确模型
- gson - 如何在 JAVA 中包装改造响应?
- django - 让 django 在 docker-compose 中使用 `network_mode: host`
- cygwin - Q:镜像下载步骤cygwin安装报错怎么处理?