Skip to content

Commit

Permalink
chore: Better align backtesting charts
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Dec 28, 2024
1 parent b413a90 commit d8a4f27
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ declare global {
const defineComponent: typeof import('vue')['defineComponent']
const defineStore: typeof import('pinia')['defineStore']
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
const echartsGridDefault: typeof import('./utils/charts/chartZoom')['echartsGridDefault']
const effectScope: typeof import('vue')['effectScope']
const exportForTesting: typeof import('./utils/formatters/timeformat')['exportForTesting']
const extendRef: typeof import('@vueuse/core')['extendRef']
Expand Down Expand Up @@ -436,6 +437,7 @@ declare module 'vue' {
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
readonly echartsGridDefault: UnwrapRef<typeof import('./utils/charts/chartZoom')['echartsGridDefault']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly exportForTesting: UnwrapRef<typeof import('./utils/formatters/timeformat')['exportForTesting']>
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
Expand Down
4 changes: 1 addition & 3 deletions src/components/charts/CumProfitChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,7 @@ const cumProfitChartOptions: ComputedRefWithControl<EChartsOption> = computedWit
},
],
grid: {
left: '55',
right: '20',
bottom: 80,
...echartsGridDefault,
},
dataZoom: [
{
Expand Down
3 changes: 3 additions & 0 deletions src/components/charts/MarketChangeChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ const dailyChartOptions: ComputedRef<EChartsOption> = computed(() => {
},
},
},
grid: {
...echartsGridDefault,
},
legend: {
data: [CHART_MARKET_CHANGE],
right: '5%',
Expand Down
7 changes: 4 additions & 3 deletions src/components/charts/ProfitDistributionChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ const chartOptions = computed((): EChartsOption => {
position: 'left',
},
],
// grid: {
// bottom: 80,
// },
grid: {
...echartsGridDefault,
bottom: 50,
},
series: [
{
Expand Down
4 changes: 2 additions & 2 deletions src/components/charts/TradesLogChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ const chartOptions = computed((): EChartsOption => {
},
],
grid: {
right: 50,
bottom: 80,
...echartsGridDefault,
left: 80,
},
dataZoom: [
{
Expand Down
6 changes: 6 additions & 0 deletions src/utils/charts/chartZoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ export const dataZoomPartial = {
handleIcon,
handleSize: '80%',
};

export const echartsGridDefault = {
left: '55',
right: '30',
bottom: 80,
};

0 comments on commit d8a4f27

Please sign in to comment.