config.ts
1.33 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
import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
import { HeatmapConfig } from './index'
import { CreateComponentType } from '@/packages/index.d'
import { cloneDeep } from 'lodash'
import dataJson from './data.json'
export const includes = ['xAxis', 'yAxis', 'grid']
export const option = {
dataset: { ...dataJson },
tooltip: {
position: 'top'
},
xAxis: {
data: dataJson.xAxis
},
yAxis: {
showRange: false,
data: dataJson.yAxis
},
visualMap: {
show: true,
min: 0,
max: 10,
itemWidth: 20,
itemHeight: 140,
calculable: true,
orient: 'horizontal',
inRange: {
// 高 -> 低
color: ['#4661c2', '#263253']
}
},
series: [
{
name: '',
type: 'heatmap',
data: dataJson.seriesData,
label: {
show: true
},
emphasis: {
itemStyle: {
borderColor: '#333',
borderWidth: 1,
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
progressive: 1000,
animation: false
}
]
}
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = HeatmapConfig.key
public chartConfig = cloneDeep(HeatmapConfig)
// 图表配置项
public option = echartOptionProfixHandle(option, includes)
}