보통 평균값, 기준값 등 나타낼때 쓰는듯.
See the Pen highchart yAxis line (plotLines) by publisher.kim (@publisherkim) on CodePen.
* 하이차트 전역 옵션 먼저 적용됨 (https://umings.github.io/file/highchart_common.js)
//chart
Highcharts.chart('chart', {
xAxis: {
categories: ["'22.09", "'22.10", "'22.11", "'22.12", "'23.01", "'23.02", "'23.03", "'23.04", "'23.05", "'23.06", "'23.07", "'23.08"],
labels: {
y: 20,
},
},
yAxis: {
plotLines: [{
value: 5000,
color: '#ff0000',
width: 2,
zIndex: 4,
dashStyle: 'dash', // plotLines를 점선으로 설정
label: {
text: '평균',
align: 'right', // 평균 라벨을 오른쪽으로 정렬
style: { // label 스타일 설정
color: '#ff0000',
fontWeight: '700',
fontSize: '14px',
},
y : -10
}
}]
},
series: [{
name: '시리즈1',
type: 'column',
data: [7000, 7598, 6765, 5645, 8978, 7874, 6712, 5246, 8978, 7874, 6712, 5246],
}, {
name: '시리즈2',
type: 'spline',
data: [7598, 6765, 5645, 8978, 7874, 6712, 5246, 8978, 7874, 6712, 5246, 7000],
}]
});
728x90
'퍼블리싱 > highchart' 카테고리의 다른 글
일주일간 15분 단위로 데이터 넣기 highchart 1week data (every 15 minutes) (0) | 2023.09.13 |
---|---|
legend에서 특정 item의 click이 안되게 할때 옵션 (0) | 2023.09.13 |
tooltip의 poinformat을 수정해야 할 때 (0) | 2023.09.13 |
자주 쓰는 차트 전역 옵션 (0) | 2023.09.13 |
seriese의 특정 data만 색상 다르게 넣기 highchart series one data color differnt (0) | 2023.09.13 |