config.ts
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
import { AddLinePlotConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
export const seriesItem = {
type: 'line',
showSymbol: false,
clip: true,
data: dataJson
}
export const option = {
animation: false,
grid: {
top: 40,
left: 50,
right: 40,
bottom: 50
},
xAxis: {
name: 'x',
minorTick: {
show: true
},
minorSplitLine: {
show: true
}
},
yAxis: {
name: 'y',
minorTick: {
show: true
},
minorSplitLine: {
show: true
}
},
dataZoom: [
{
show: true,
type: 'inside',
filterMode: 'none',
xAxisIndex: [0],
startValue: -20,
endValue: 20
},
{
show: true,
type: 'inside',
filterMode: 'none',
yAxisIndex: [0],
startValue: -20,
endValue: 20
}
],
dataset:dataJson,
series: [seriesItem]
}
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = AddLinePlotConfig.key
public chartConfig = cloneDeep(AddLinePlotConfig)
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
}