Commit ac8721b5 by 呼呼啦啦

修改

parent f9e4feaa
import {
getPadding,
getTheme,
getTooltip
} from '@/views/chart/chart/common/common_antv'
import { Scene, HeatmapLayer } from '@antv/l7'
import { GaodeMap } from '@antv/l7-maps'
import { getLanguage } from '@/lang'
export function baseHeatMapOptionAntV(chartDom, chartId, chart, action) {
console.log('baseHeatMapOptionAntV', chartDom)
console.log('baseHeatMapOptionAntV', chart)
const xAxis = JSON.parse(chart.xaxis)
const xAxisExt = JSON.parse(chart.xaxisExt)
const yAxis = JSON.parse(chart.yaxis)
let customAttr
if (chart.customAttr) {
customAttr = JSON.parse(chart.customAttr)
......@@ -31,7 +26,8 @@ export function baseHeatMapOptionAntV(chartDom, chartId, chart, action) {
map: new GaodeMap({
lang: lang,
pitch: size.mapPitch,
style: mapStyle
style: mapStyle,
zoom: 3
}),
logoVisible: false
})
......@@ -42,7 +38,7 @@ export function baseHeatMapOptionAntV(chartDom, chartId, chart, action) {
chartDom.setMapStyle(mapStyle)
}
}
if (xAxis?.length < 2 || xAxisExt?.length < 2) {
if (xAxis?.length < 1 || yAxis?.length < 1) {
chartDom.removeAllLayer()
return chartDom
}
......@@ -53,19 +49,11 @@ export function baseHeatMapOptionAntV(chartDom, chartId, chart, action) {
parser: {
type: 'json',
x: xAxis[0].dataeaseName,
y: xAxis[1].dataeaseName,
x1: xAxisExt[0].dataeaseName,
y1: xAxisExt[1].dataeaseName
y: xAxis[1].dataeaseName
}
})
.size(size.mapLineWidth)
.shape('heatmap')
.animate({
enable: size.mapLineAnimate,
duration: size.mapLineAnimateDuration,
interval: 1,
trailLength: 1
}).style({
.style({
intensity: 2,
radius: 20,
rampColors: {
......@@ -76,22 +64,15 @@ export function baseHeatMapOptionAntV(chartDom, chartId, chart, action) {
'#FFF598',
'#F7B74A',
'#FF4818'
].reverse(),
],
positions: [0, 0.2, 0.4, 0.6, 0.8, 1.0]
}
})
if (color.mapLineGradient) {
layer.style({
sourceColor: color.mapLineSourceColor,
targetColor: color.mapLineTargetColor,
opacity: color.alpha / 100
.size('mag', [1, 80])
.scale('mag', {
type: 'linear',
domain: [1, 50]
})
} else {
layer.style({
opacity: color.alpha / 100
})
.color(color.mapLineSourceColor)
}
if (!init) {
chartDom.addLayer(layer)
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论