我有一个看起来像这样的轻量级图表设置。我想添加某种配置,以便图表可以显示本地时间,而不是 Unix 时间戳传递的通用时间,例如,它与我的时间相差几个小时。另一种可能性是修改 Unix 时间戳。
var chart = LightweightCharts.createChart(document.getElementById("charts"), {
width: 1060,
height: 537,
layout: {
backgroundColor: "#161616",
textColor: "rgba(255, 255, 255, 0.9)",
fontSize: 15,
fontFamily: "Ubuntu",
},
grid: {
vertLines: {
color: "#424242",
width: 0.3,
},
horzLines: {
color: "#424242",
width: 0.3,
},
},
crosshair: {
mode: LightweightCharts.CrosshairMode.Normal,
},
priceScale: {
borderColor: "rgba(197, 203, 206, 0.8)",
size: 5,
},
timeScale: {
borderColor: "rgba(197, 203, 206, 0.8)",
timeVisible: true,
secondsVisible: false,
rightBarStaysOnScroll: true,
},
});