mirror of
https://git.hmsn.ink/coin/chart.git
synced 2026-03-20 00:02:17 +09:00
차트 정의 완료
This commit is contained in:
@@ -79,7 +79,7 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(['lazyLoad'])
|
||||
const emits = defineEmits(['lazyLoad', 'mouseMove'])
|
||||
|
||||
function getChartSeriesDefinition(type) {
|
||||
switch (type.toLowerCase()) {
|
||||
@@ -204,6 +204,7 @@ onMounted(() => {
|
||||
}
|
||||
chart.timeScale().subscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChanged);
|
||||
|
||||
chart.subscribeCrosshairMove(onCrosshairMove)
|
||||
});
|
||||
|
||||
function onVisibleLogicalRangeChanged(newVisibleLogicalRange) {
|
||||
@@ -216,6 +217,17 @@ function onVisibleLogicalRangeChanged(newVisibleLogicalRange) {
|
||||
}
|
||||
}
|
||||
|
||||
function onCrosshairMove(param) {
|
||||
|
||||
if (param.point === null || param.time === undefined) {
|
||||
return;
|
||||
}
|
||||
emits('mouseMove', param.seriesData.get(candlestick))
|
||||
//
|
||||
// // 현재 포인터 아래의 캔들 데이터 가져오기
|
||||
// const data = param.seriesData.get(candleSeries);
|
||||
// console.log(data)
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
if (chart) {
|
||||
|
||||
Reference in New Issue
Block a user