我正在使用 AmCharts/AmStockCharts 显示跨越全年的数据折线图。它通常放大以显示一个月,因为这是一个有用的缩放级别。
但是,它默认为有数据的上个月,我想将其设置为显示当前月份。
目前这是图表的配置:
AmCharts.makeChart("overview_chart", {
type: "stock",
"theme": "light",
"categoryAxesSettings": {
minPeriod: "1hh",
groupToPeriods: ["1hh"]
},
dataSets: [
{
fieldMappings: fieldMappings,
dataProvider: chartData,
title: "Overview",
categoryField: "date"
}
],
panels: [
{
title: "Results",
showCategoryAxis: true,
percentHeight: 70,
valueAxes: [
{
id: "v1",
stackType: "regular"
}
],
categoryAxis: {
dashLength: 5
},
stockGraphs: stockGraphs,
stockLegend: {
align: "left",
position: "absolute",
divId: "optimizationLegend"
}
}
],
chartScrollbarSettings: {
graph: "Total", // shows nice profile
graphType: "line",
usePeriod: "1hh"
},
chartCursorSettings: {
valueBalloonsEnabled: true,
valueLineBalloonEnabled: true,
valueLineEnabled: true,
categoryBalloonText: '[[category]]',
categoryBalloonDateFormats: [
{
period: "YYYY",
format: "DD.MM.YYYY HH:NN"
}, {
period: "MM",
format: "DD.MM.YYYY HH:NN"
}, {
period: "WW",
format: "DD.MM.YYYY HH:NN"
}, {
period: "DD",
format: "DD.MM.YYYY HH:NN"
}, {
period: "hh",
format: "DD.MM.YYYY HH:NN"
}, {
period: "mm",
format: "DD.MM.YYYY HH:NN"
}, {
period: "ss",
format: "DD.MM.YYYY HH:NN"
}, {
period: "fff",
format: "DD.MM.YYYY HH:NN"
}
]
},
periodSelector: {
position: "bottom",
periods: [
{
period: "MM",
selected: true,
count: 1,
label: "1 month"
}, {
period: "YYYY",
count: 1,
label: "1 year"
}, {
period: "YTD",
label: "YTD"
}, {
period: "MAX",
label: "MAX"
}
]
},
"export": {
"enabled": true
}
});
我该怎么做?