highcharts - 为什么 xAxis.min 不起作用,但 xAxis.max 是?
问题描述
我正在使用像这个演示这样的 Highstock 图表:https ://www.highcharts.com/demo/stock/responsive
当我设置 xAxis.max 时它可以工作,但是添加 xAxis.min 它会发送正确的时间间隔(1 年)但在错误的日期,在图表的末尾(2021 年 7 月)。
我真的不明白这是怎么回事...
非常感谢
Highcharts.stockChart('container', {
data: {
googleSpreadsheetKey: 'XXX'
},
chart: {
styledMode: true,
},
xAxis: {
min: Date.UTC(2020, 2, 1),
max: Date.UTC(2021, 2, 1)
},
rangeSelector: {
allButtonsEnabled: true,
buttonSpacing: 10,
buttons: [{
type: 'week',
count: 1,
text: '1 Week'
}, {
type: 'month',
count: 1,
text: '1 Month'
}, {
type: 'month',
count: 3,
text: '3 Months'
}, {
type: 'year',
count: 1,
text: '1 Year'
}, {
type: 'ytd',
text: 'YtD'
}, {
type: 'all',
text: 'Max'
}],
buttonTheme: {
width: 75,
}
},
series: [{
color: '#005d98',
name: 'USD',
type: 'area',
gapSize: 5,
tooltip: {
valueDecimals: 2
},
fillColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 2
},
},
threshold: null
}]
});```
解决方案
推荐阅读
- javascript - 如何删除 gtag 上的初始网页浏览命中
- php - PHP在十进制的4个非零数字后切掉数字
- nlp - 如何在 Google Colab 中导入保存的模块?
- java - 数组返回 null
- python-3.x - 在 python 3 中访问 if 语句时遇到问题
- ios - 使用 ImageSlideshow pod 时显示上一个 tableview 单元格中的重复图像
- javascript - 如何以金字塔形状打印 1 到 10
- reactjs - 有什么办法可以防止计数器重新启动
- java - 如何在 Spring Boot 应用程序(Hibernate + JPA)中从 Postgresql 中提取图像(lob)?
- rust - 如何在 rust 的 src 之外的测试目录中使用 lib?