units (xAxis properties)
시간 축에서 눈금이 놓일 수 있는 시간 단위와 배수를 설정합니다.
각 항목은 [단위, [배수 목록]] 형식입니다. 단위는 millisecond, second, minute, hour, day, week, month, year입니다. 예를 들어 [["month", [1, 3]]]이면 눈금이 1개월 또는 3개월 간격으로만 놓입니다.
Info
| name |
type |
required(default) |
description |
| units |
Array |
선택(undefined) |
시간 축에서 눈금이 놓일 수 있는 시간 단위와 배수를 설정합니다. |
Example
myChart.setOptions({
chart: {
type: "line"
},
xAxis: {
type: "datetime",
units: [
["month", [1]]
]
},
series: [{
name: "방문자",
pointStart: Date.UTC(2025, 0, 1),
pointInterval: 24 * 3600 * 1000,
data: [50, 87, 64, 101, 78, 55, 92, 69, 106, 83, 60, 97, 74, 51, 88, 65, 102, 79, 56, 93, 70, 107, 84, 61, 98, 75, 52, 89, 66, 103, 80, 57, 94, 71, 108, 85, 62, 99, 76, 53, 90, 67, 104, 81, 58, 95, 72, 109, 86, 63, 100, 77, 54, 91, 68, 105, 82, 59, 96, 73, 50, 87, 64, 101, 78, 55, 92, 69, 106, 83, 60, 97, 74, 51, 88, 65, 102, 79, 56, 93, 70, 107, 84, 61, 98, 75, 52, 89, 66, 103, 80, 57, 94, 71, 108, 85, 62, 99, 76, 53]
}]
}, {
append: true,
redraw: true
});
제공 버전