Skip to content

Commit

Permalink
Update CandleChart.vue
Browse files Browse the repository at this point in the history
Signed-off-by: gitworkflows <[email protected]>
  • Loading branch information
gitworkflows authored Apr 10, 2024
1 parent a2aecb5 commit 42f4030
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/components/charts/CandleChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
PlotConfig,
Trade,
} from '@/types';
import { format } from 'date-fns-tz';
import ECharts from 'vue-echarts';
Expand Down Expand Up @@ -44,7 +43,8 @@ import {
} from 'echarts/components';
import { use } from 'echarts/core';
import { CanvasRenderer } from 'echarts/renderers';
import { timestampms } from '@/shared/formatters';
use([
AxisPointerComponent,
CalendarComponent,
Expand Down Expand Up @@ -644,16 +644,12 @@ function initializeChartOptions() {
function updateSliderPosition() {
if (!props.sliderPosition) return;
const start = format(
props.sliderPosition.startValue - props.dataset.timeframe_ms * 40,
'yyyy-MM-dd HH:mm:ss',
);
const end = format(
props.sliderPosition.endValue
const start = timestampms(props.sliderPosition.startValue - props.dataset.timeframe_ms * 40);
const end = timestampms(
props.sliderPosition.endValue
? props.sliderPosition.endValue + props.dataset.timeframe_ms * 40
: props.sliderPosition.startValue + props.dataset.timeframe_ms * 80,
'yyyy-MM-dd HH:mm:ss',
);
if (candleChart.value) {
candleChart.value.dispatchAction({
Expand Down

0 comments on commit 42f4030

Please sign in to comment.