Use tree-shaking API imports

This commit is contained in:
Matthias 2021-05-24 17:45:20 +02:00
parent 6cd941fb9a
commit 8ed1929f27
4 changed files with 55 additions and 33 deletions

View File

@ -9,17 +9,15 @@ import { Getter } from 'vuex-class';
import ECharts from 'vue-echarts';
import { EChartsOption } from 'echarts';
import 'echarts/lib/chart/bar';
import 'echarts/lib/chart/line';
import 'echarts/lib/component/title';
import 'echarts/lib/component/tooltip';
import 'echarts/lib/component/legend';
import 'echarts/lib/component/dataZoom';
import 'echarts/lib/component/visualMap';
import 'echarts/lib/component/visualMapPiecewise';
import { use } from 'echarts/core';
import { CanvasRenderer } from 'echarts/renderers';
import { LineChart, BarChart } from 'echarts/charts';
import { TitleComponent, TooltipComponent, LegendComponent } from 'echarts/components';
import { ClosedTrade, CumProfitData } from '@/types';
use([BarChart, LineChart, CanvasRenderer, TitleComponent, TooltipComponent, LegendComponent]);
// Define Column labels here to avoid typos
const CHART_PROFIT = 'Profit';
const CHART_TRADE_COUNT = 'Trade Count';

View File

@ -8,14 +8,15 @@ import { Getter } from 'vuex-class';
import ECharts from 'vue-echarts';
import { EChartsOption } from 'echarts';
import 'echarts/lib/chart/bar';
import 'echarts/lib/chart/line';
import 'echarts/lib/component/title';
import 'echarts/lib/component/tooltip';
import 'echarts/lib/component/legend';
import { use } from 'echarts/core';
import { CanvasRenderer } from 'echarts/renderers';
import { LineChart, BarChart } from 'echarts/charts';
import { TitleComponent, TooltipComponent, LegendComponent } from 'echarts/components';
import { DailyReturnValue } from '@/types';
use([BarChart, LineChart, CanvasRenderer, TitleComponent, TooltipComponent, LegendComponent]);
// Define Column labels here to avoid typos
const CHART_ABS_PROFIT = 'Absolute profit';
const CHART_TRADE_COUNT = 'Trade Count';

View File

@ -13,18 +13,32 @@ import { Getter } from 'vuex-class';
import ECharts from 'vue-echarts';
import 'echarts/lib/chart/bar';
import 'echarts/lib/chart/line';
import 'echarts/lib/component/title';
import 'echarts/lib/component/tooltip';
import 'echarts/lib/component/legend';
import 'echarts/lib/component/visualMap';
import 'echarts/lib/component/visualMapPiecewise';
import { Trade } from '@/types';
import { timestampHour } from '@/shared/formatters';
import { EChartsOption } from 'echarts';
import { use } from 'echarts/core';
import { CanvasRenderer } from 'echarts/renderers';
import { LineChart, BarChart } from 'echarts/charts';
import {
TitleComponent,
TooltipComponent,
LegendComponent,
VisualMapComponent,
VisualMapPiecewiseComponent,
} from 'echarts/components';
use([
BarChart,
LineChart,
CanvasRenderer,
TitleComponent,
TooltipComponent,
LegendComponent,
VisualMapComponent,
VisualMapPiecewiseComponent,
]);
// Define Column labels here to avoid typos
const CHART_PROFIT = 'Profit %';
const CHART_TRADE_COUNT = 'Trade Count';

View File

@ -9,17 +9,30 @@ import { Getter } from 'vuex-class';
import ECharts from 'vue-echarts';
import { EChartsOption } from 'echarts';
import 'echarts/lib/chart/bar';
import 'echarts/lib/chart/line';
import 'echarts/lib/component/title';
import 'echarts/lib/component/tooltip';
import 'echarts/lib/component/legend';
import 'echarts/lib/component/dataZoom';
import 'echarts/lib/component/visualMap';
import 'echarts/lib/component/visualMapPiecewise';
import { use } from 'echarts/core';
import { CanvasRenderer } from 'echarts/renderers';
import { LineChart, BarChart } from 'echarts/charts';
import {
TitleComponent,
TooltipComponent,
LegendComponent,
VisualMapComponent,
VisualMapPiecewiseComponent,
} from 'echarts/components';
import { ClosedTrade } from '@/types';
use([
BarChart,
LineChart,
CanvasRenderer,
TitleComponent,
TooltipComponent,
LegendComponent,
VisualMapComponent,
VisualMapPiecewiseComponent,
]);
// Define Column labels here to avoid typos
const CHART_PROFIT = 'Profit %';
const CHART_COLOR = '#9be0a8';
@ -126,7 +139,6 @@ export default class TradesLogChart extends Vue {
{
type: 'bar',
name: CHART_PROFIT,
step: 'start',
barGap: '0%',
barCategoryGap: '0%',
animation: false,
@ -143,9 +155,6 @@ export default class TradesLogChart extends Vue {
y: 1,
},
areaStyle: {
// color: CHART_COLOR,
},
itemStyle: {
color: CHART_COLOR,
},