使StockCharts中的工具提示与HighCharts中的相同
Make the tooltip in StockCharts behave the same as in HighCharts
如何使StockChart工具提示的行为与HighCharts相同?
如果您看一下,在Stock Chart中,光标移动到鼠标位置,在"Chart"实例中,工具提示会锁定到最近的点。
小提琴来了:
http://jsfiddle.net/gn393/$(function () {
var chart = new Highcharts.StockChart({
chart: {
renderTo: 'container1'
},
tooltip: {
positioner: function (w,h,p) {
return { x: p.plotX + chart.plotLeft, y: p.plotY + chart.plotTop };
}
},
series: [{type:"area",
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
data: [194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4]
}]
});
});
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container2'
},
tooltip: {
positioner: function (w,h,p) {
return { x: p.plotX + chart.plotLeft, y: p.plotY + chart.plotTop };
}
},
series: [{type:"area",
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
data: [194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4]
}]
});
});
我需要工具提示捕捉到StockChart上最近的点。
这就是Highcharts中共享工具提示的工作原理。您需要禁用它(shared: false
),以获得所需的结果,请查看:http://jsfiddle.net/gn393/1/
相关文章:
- 柱状图上的Highcharts工具提示
- Highcharts工具提示不显示corrosconding文本值,而是显示'未定义'
- Highcharts-在单击而不是悬停时显示工具提示
- 使用共享工具提示时,单击Highcharts柱形图会返回不正确的序列索引
- highcharts:更改工具提示和阴影(悬停)的标准位置
- Highcharts列范围工具提示问题
- 使用 jquery 替换的 Highcharts 工具提示格式化程序
- 获取 Highcharts 工具提示以返回角度指令
- 显示所选点的Highcharts工具提示
- 堆叠柱形图的Highcharts工具提示错误
- Highcharts工具提示图像
- Highcharts工具提示格式化器返回函数抛出未捕获的TypeError: j.i call不是函数
- HIghcharts工具提示仅用于起点和终点
- Highcharts工具提示中的可点击链接
- 如何表示小时到小时的Highcharts工具提示-时间序列
- Highcharts:工具提示点格式为十进制到百分比
- 使用templeteUrl让Highcharts工具提示返回一个angular指令
- 如何从json数据标记Highcharts工具提示
- Highcharts工具提示格式化程序只显示this.point.name中的前8个字符
- 如何从配置对象外部调用Highcharts工具提示格式化程序函数