使用highcharts在x轴上显示绘图值 [英] Display the Plotted value on x axis using highcharts
问题描述
如何正确显示图表上的精确毫秒数?如何将点或工具提示设置为精确毫秒?
xAxis:{
类型:'datetime',
plotLines:[{
color:'#FF0000',
width:2,
value:1366113390066
}]
}
由于您的数据数组不是可用的格式, p>
这:
data:[{
'value' :731,
'timestamp':1366032438641
}
应该是
this:
data:[{
'x':1366032438641,
'y' :731
}
或者更简单的说:
data:[[1366032438641,731]]
参考: http://api.highcharts.com /highcharts#series.data
您必须澄清您对问题其他部分的含义。
编辑:{b / p>
如果您需要实际的毫秒精度,则必须在图表中具有足够的宽度以指定每毫秒的像素。这显然不会在任何实际的图表中发生。
没有办法在600像素宽的图表中显示2像素宽的线,显示20多个小时,它精确到毫秒。
600像素约为7200万毫秒,每毫秒0.0000083像素......(或每像素120,000毫秒)
:)
How to display the plotted value correctly to the exact milliseconds on the chart? How place a point or tooltip to exact milliseconds?
xAxis: {
type: 'datetime',
plotLines: [{
color: '#FF0000',
width: 2,
value: 1366113390066
}]
}
Your series is not showing because your data array is not in a usable format.
this:
data: [{
'value': 731,
'timestamp': 1366032438641
}
should be either this:
data: [{
'x': 1366032438641,
'y': 731
}
or, more simply, this:
data: [[1366032438641,731]]
reference: http://api.highcharts.com/highcharts#series.data
You'll have to clarify what you mean about the other part of your question.
EDIT:{
If you want actual millisecond precision, you will have to have enough width in your chart to specify a pixel per millisecond. This is not going to happen in any real chart obviously.
There's no way to draw a 2 pixel wide line in a ~600 pixel wide chart displaying 20+ hours and have it be precise to a millisecond.
That's about 72 million milliseconds in 600 pixels, which works out to 0.0000083 pixels per millisecond... (or 120,000 milliseconds per pixel)
:)
这篇关于使用highcharts在x轴上显示绘图值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!