所有日期时间显示的日期轴,而不是amcharts4中的小时

问题描述 投票:1回答:1

我不愿意在dateAxis中尝试所有参数,但显示了标签日期小时部分

var dateAxis = chart.xAxes.push(new am4charts.DateAxis());
dateAxis.renderer.minGridDistance = 20;
dateAxis.renderer.grid.template.location = 0.5;
dateAxis.startLocation = 0.5;
dateAxis.endLocation = 0.5;
dateAxis.dateFormats.setKey("day", "YYYY/MM/dd hh:mm");
dateAxis.tooltipDateFormat = "YYYY/MM/dd HH:mm";
// Setting up label rotation
dateAxis.renderer.labels.template.rotation = 45;

image hown just hour in lable

amcharts amcharts4
1个回答
1
投票

DateAxis处于“小时”模式时,您正在为“日”设置格式。您需要为此进行设置。在执行此操作时,请确保同时设置周期更改:

dateAxis.dateFormats.setKey("hour", "YYYY/MM/dd hh:mm");
dateAxis.periodChangeDateFormats.setKey("hour", "YYYY/MM/dd hh:mm");

确保read this关于DateAxis上的格式。

© www.soinside.com 2019 - 2024. All rights reserved.