Angular 如何在Highchart中显示小时数据
我在海图上显示了当天的系列数据。现在在1天内有24小时显示,我在Y轴上显示24小时标签 现在,问题是某些元素的数据包含前一天的数据 例如: 当我选择3月26日数据时,它包含从午夜开始的3月25日数据,这些数据被忽略,并且没有绘制在图表中 是否有任何方法可以绘制上个月的系列数据 我的Highchart配置代码:Angular 如何在Highchart中显示小时数据,angular,highcharts,Angular,Highcharts,我在海图上显示了当天的系列数据。现在在1天内有24小时显示,我在Y轴上显示24小时标签 现在,问题是某些元素的数据包含前一天的数据 例如: 当我选择3月26日数据时,它包含从午夜开始的3月25日数据,这些数据被忽略,并且没有绘制在图表中 是否有任何方法可以绘制上个月的系列数据 我的Highchart配置代码: highchartsConfiguration: any = { chart: { zoomType: 'x', plot
highchartsConfiguration: any = {
chart: {
zoomType: 'x',
plotBackgroundColor: 'rgba( 191, 192, 194, 0 )',
events: {
click(e) {
if (!($(event.target)[0].textContent)) {
PlotBandService.plotBandClicked(moment(e.xAxis[0].value).utc().format('YYYY-MM-DD HH:mm:ss'));
}
},
},
},
title: {
text: '',
},
yAxis: {
title: {
style: {
'font-family': 'Arial',
'font-size': 12,
'font-weight': 'bold',
},
},
allowDecimals: false,
lineWidth: 1,
lineColor: 'black',
},
xAxis: {
lineWidth: 1,
lineColor: 'black',
type: 'datetime',
alternateGridColor: 'rgba(191, 192, 194, .2)',
// startOnTick: true,
// endOnTick: true,
tickInterval: 30 * 24 * 3600 * 1000,
dateTimeLabelFormats: {
hour: '%H',
day: '%e. %b',
week: 'CW: %W',
month: '%b \'%y',
year: '%Y',
},
units: [[
'hour',
[1],
], [
'day',
[1],
], [
'week',
[1],
], [
'month',
[1],
], [
'year',
null,
]],
plotLines: [{
id: 'plotLine',
color: '#0000FF',
width: 2,
}],
labels: {
align: 'left',
},
},
legend: {
enabled: false,
},
};
我不能重现那种行为。你能为这个问题举个活生生的例子吗?你的起点可以是这把小提琴-就像你在小提琴上一样,工具提示中没有以前的数据。@morganfree非常感谢,但我得到了我的解决方案。