diff --git a/package.json b/package.json index bdc6541..3da82ed 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "notyf": "3.10.0", "pinia": "2.1.7", "std-env": "^3.9.0", - "technicalindicators": "^3.1.0", "unplugin-vue-router": "^0.15.0", "vite-plugin-pwa": "^1.0.3", "vite-plugin-vuetify": "^2.1.2", diff --git a/src/App.vue b/src/App.vue index c6b8c4b..c64797e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,6 +13,10 @@ import {getCandleList} from '/@src/utils/api' import {calculateMACD, calculateEMA, calculateBollingerBands, calculateRSI} from "./utils/meter.js"; import {entrySignals} from "./utils/cro.js"; import {swingSignal} from "./utils/sig.js"; +import { useWindowSize } from '@vueuse/core' + +const { width, height } = useWindowSize() +console.log(width, height) /** * Generates sample data for the lightweight chart * @param {Boolean} ohlc Whether generated dat should include open, high, low, and close values @@ -33,7 +37,8 @@ const chartOptions = ref({ separatorColor: '#FF0000', }, }, - height: 1300, + width: width, + height: height, timeScale: { timeVisible: true, // 분/초까지 표시 secondsVisible: false // 초 숨기고 싶으면 false @@ -55,6 +60,8 @@ const selectCoins = [ { title: 'LINK_USDT'}, ] const selectTimes = [ + { title: '10s'}, + { title: '1m'}, { title: '5m'}, { title: '15m'}, { title: '30m'}, diff --git a/src/components/LWChart.vue b/src/components/LWChart.vue index b9b7fa6..982d27a 100644 --- a/src/components/LWChart.vue +++ b/src/components/LWChart.vue @@ -219,8 +219,15 @@ onMounted(() => { chart.timeScale().subscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChanged); chart.subscribeCrosshairMove(onCrosshairMove) + + chart.subscribeClick(onClick); + }); +function onClick(dd) { + console.log(dd) +} + function onVisibleLogicalRangeChanged(newVisibleLogicalRange) { const barsInfo = candlestick.barsInLogicalRange(newVisibleLogicalRange); // if there less than 50 bars to the left of the visible area diff --git a/types/imports.d.ts b/types/imports.d.ts index d3a5c74..16f9057 100644 --- a/types/imports.d.ts +++ b/types/imports.d.ts @@ -109,6 +109,7 @@ declare global { const toRef: typeof import('vue')['toRef'] const toRefs: typeof import('vue')['toRefs'] const toValue: typeof import('vue')['toValue'] + const trendLine: typeof import('../src/utils/drawing')['trendLine'] const triggerRef: typeof import('vue')['triggerRef'] const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount'] const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount'] diff --git a/vite.config.ts b/vite.config.ts index 2c3081c..90618ab 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -256,7 +256,6 @@ export default defineConfig(({ isSsrBuild }) => ({ 'vuetify/framework', 'vuetify/components', 'vuetify/directives', - 'technicalindicators', 'notyf', 'vue', 'vue-i18n',