jquery - 我使用 Highcharts 创建了一个散点图,但 point.z 值未显示在工具提示中
问题描述
我创建了一个散点图,如下所示:
$(function() {
$('#container').highcharts({
tooltip: {
formatter: function() {
return 'x: ' + this.x + ', y: ' + this.y + ', z: ' + this.point.z;
}
},
series: [{
type: 'scatter',
data: [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
}]
});
});
this.point.z 值未在工具提示中显示。有人可以帮忙吗?
解决方案
您还可以使用keys
选项:
series: [{
keys: ['x', 'y', 'z'],
type: 'scatter',
data: [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
}]
现场演示:http: //jsfiddle.net/BlackLabel/xem9ghcw/
API 参考: https ://api.highcharts.com/highcharts/series.scatter.keys
推荐阅读
- linux - LFS CoreUtils-8.30 失败,缺少 aclocal-1.15
- excel - Excel VBA - 集合 = 没有什么比创建集合要长 100 倍
- java - 为什么 Flink SQL 对所有表都使用 100 行的基数估计?
- c# - 圆弧图形质量
- c++ - 添加和初始化新的 std::map 元素的最有效方法是什么?
- postgresql - 如何在 postgresql 中的特定列值之后获取下 n 行
- excel - 用户表单日期未在电子表格中以正确格式显示
- python - 执行此代码时出现python中的更大或更小符号
- android - TextView 未发送 ACCESSIBILITY_FOCUS_CLEARED 事件
- powershell - 显示每个用户所属组的脚本