Highcharts 高位图表-带时间范围的列范围图表。如何获取工具提示作为开始和结束时间
我正在做一个有一定时间范围的列范围图。基本上,我们想要绘制不同进程在一个接一个进程中所花费的不同时间。这里以小提琴为例Highcharts 高位图表-带时间范围的列范围图表。如何获取工具提示作为开始和结束时间,highcharts,Highcharts,我正在做一个有一定时间范围的列范围图。基本上,我们想要绘制不同进程在一个接一个进程中所花费的不同时间。这里以小提琴为例 $(function () { $('#container').highcharts({ chart: { type: 'columnrange', inverted: true }, title: { text: 'Temperature va
$(function () {
$('#container').highcharts({
chart: {
type: 'columnrange',
inverted: true
},
title: {
text: 'Temperature variation by month'
},
subtitle: {
text: 'Observed in Vik i Sogn, Norway, 2009'
},
xAxis: {
categories: ['02/07/2013', '03/07/2013', '04/07/2013']
},
yAxis: {
type: 'datetime',
title: {
text: 'Temperature ( °C )'
}
},
tooltip: {
valueSuffix: '°C'
},
plotOptions: {
columnrange: {
dataLabels: {
enabled: true,
formatter: function () {
return this.y + '°C';
}
}
}
},
legend: {
enabled: false
},
series: [{
name: 'Temperatures',
data: [
[Date.UTC(2013, 07, 02, 21, 0, 0), Date.UTC(2013, 07, 03, 4, 0, 0)],
[Date.UTC(2013, 07, 02, 21, 0, 0), Date.UTC(2013, 07, 03, 5, 0, 0)],
[Date.UTC(2013, 07, 02, 21, 0, 0), Date.UTC(2013, 07, 03, 6, 0, 0)]
]
}]
});
});
在本例中,我无法将工具top设置为“进程X在X时间开始,在y时间结束”
工具提示:{
格式化程序:函数(){
返回从“+Highcharts.dateFormat”(“%H:%M”,this.y[0])开始的“+this.x+”;
}
当我将值作为这个.Y时,我只得到开始时间
我们将非常感谢您在这方面提供的任何帮助。使用
点.低值和点.高值
tooltip: {
formatter: function () {
console.log(this);
return '<b>' + this.x + '</b> started at <b>' + Highcharts.dateFormat('%H:%M', this.point.low) + '</b> and ended at <b>' + Highcharts.dateFormat('%H:%M', this.point.high) + '</b>';
}
},
工具提示:{
格式化程序:函数(){
console.log(this);
返回'+this.x+'开始于'+Highcharts.dateFormat('%H:%M',this.point.low)+',结束于'+Highcharts.dateFormat('%H:%M',this.point.high)+'';
}
},
这将模拟默认的Highcharts样式,但时间格式正确
工具提示:{
格式化程序:函数(){
var low=Highcharts.dateFormat(“%H:%M”,this.point.low);
var high=Highcharts.dateFormat(“%H:%M”,this.point.high);
返回“+this.point.key+”
\u25CF'+this.series.name+”:“+low+”-“+high+”
”;
}
}
tooltip: {
formatter: function () {
console.log(this);
return '<b>' + this.x + '</b> started at <b>' + Highcharts.dateFormat('%H:%M', this.point.low) + '</b> and ended at <b>' + Highcharts.dateFormat('%H:%M', this.point.high) + '</b>';
}
},