我只需要关注数组的最后 5 个元素,并允许 pan 显示我的系列的另一部分。可能吗? 这是我的例子
chart: {
type: 'bar',
toolbar: {
show: true,
tools: {
download: false,
selection: true,
zoom: true,
zoomin: true,
zoomout: true,
pan: true,
reset: true | '<img src="/static/icons/reset.png" width="20">',
customIcons: []
},
autoSelected: 'zoom'
},
},
series: [{
name: 'sales',
data: [30,40,45,50,49,60,70,91,125]
}],
xaxis: {
type: 'datetime',
categories: ['01/01/1991','01/01/1992','01/01/1993','01/01/1994','01/01/1995','01/01/1996','01/01/1997', '01/01/1998','01/01/1999']
}
}
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render(); ```