highcharts - Highcharts极地标签textoverflow
问题描述
尝试在 highcharts 7.2.0 中配置极坐标图时,我无法将图表配置为始终在 xAxis 上显示标签。当图表不是极坐标图时,xAxis.labels.styles.textOverflow = 'none' 的配置属性可以正常工作。下面的 jsfiddle 显示如果 xAxis 上的标签与另一个标签发生冲突,它们将自动被删除。我正在寻找配置极坐标图来做与折线图相同的事情。当 chart.polar: true 被移除时,您可以看到带有相互重叠标签的折线图。 https://jsfiddle.net/y6xor7ac/3/
Highcharts.chart('container', {
chart: {
// comment this line to show line graph working correctly
polar: true
},
title: {
text: 'Highcharts Polar Chart'
},
subtitle: {
text: 'Also known as Radar Chart'
},
pane: {
startAngle: 0,
endAngle: 360
},
xAxis: {
tickInterval: 45,
min: 0,
max: 360,
overflow: 'allow',
labels: {
style: {
textOverflow: 'none'
},
format: '{value}° super long text to make it overlap super long text to make it overlap super long text to make it overlap '
}
},
yAxis: {
min: 0,
overflow: 'allow',
stackLabels: {
allowOverlap: true
}
},
plotOptions: {
series: {
pointStart: 0,
pointInterval: 45
},
column: {
pointPadding: 0,
groupPadding: 0
}
},
series: [{
type: 'column',
name: 'Column',
data: [8, 7, 6, 5, 4, 3, 2, 1],
pointPlacement: 'between'
}, {
type: 'line',
name: 'Line',
data: [1, 2, 3, 4, 5, 6, 7, 8]
}, {
type: 'area',
name: 'Area',
data: [1, 8, 2, 7, 3, 6, 4, 5]
}]
});
解决方案
您可以使用内部allowOverlap
属性:
xAxis: {
...
labels: {
allowOverlap: true,
...
}
},
推荐阅读
- html5-canvas - 有没有办法重新调整一块画布?
- python - 从没有文件名的响应头 Content-Disposition 下载文件 - Python
- python - 无监督高维聚类
- shell - 如何通过 shell 脚本替换任何特定键的值
- android - 找到了一个新版本1.3.61-release-Studio3.6-1 但没有经过Android Studio验证
- python - 顺序模型总是预测 5
- azure - 如何从 Azure 中的 ResourceProperties 对象检查状态
- excel - 宏运行后保存新工作簿保留工作表名称
- android - 使用 Accessibility Service 修改另一个应用程序的视图层次结构
- security - HttpOnly 与 LocalStorage 存储 JWT