mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 21:42:32 +08:00
fix(图表): 热力图纵轴优化
This commit is contained in:
@@ -8,6 +8,7 @@ import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import {
|
||||
configAxisLabelLengthLimit,
|
||||
getPadding,
|
||||
getXAxis,
|
||||
getYAxis
|
||||
@@ -38,7 +39,15 @@ export class TableHeatmap extends G2PlotChartView<HeatmapOptions, Heatmap> {
|
||||
'basic-style-selector': ['colors'],
|
||||
'label-selector': ['fontSize', 'color'],
|
||||
'x-axis-selector': ['name', 'color', 'fontSize', 'position', 'axisLabel', 'axisLine'],
|
||||
'y-axis-selector': ['name', 'color', 'fontSize', 'position', 'axisLabel', 'axisLine'],
|
||||
'y-axis-selector': [
|
||||
'name',
|
||||
'color',
|
||||
'fontSize',
|
||||
'position',
|
||||
'axisLabel',
|
||||
'axisLine',
|
||||
'showLengthLimit'
|
||||
],
|
||||
'title-selector': [
|
||||
'title',
|
||||
'fontSize',
|
||||
@@ -194,6 +203,7 @@ export class TableHeatmap extends G2PlotChartView<HeatmapOptions, Heatmap> {
|
||||
}
|
||||
}
|
||||
})
|
||||
configAxisLabelLengthLimit(chart, newChart)
|
||||
return newChart
|
||||
}
|
||||
|
||||
|
||||
@@ -1438,8 +1438,11 @@ export function configAxisLabelLengthLimit(chart, plot) {
|
||||
}
|
||||
plot.on('axis-label:mouseenter', e => {
|
||||
const field = e.target.cfg.delegateObject.component.cfg.field
|
||||
// 不分图表纵轴通过位置判断,左右为纵轴,目前仅热力图
|
||||
const position = e.target.cfg.delegateObject.component.cfg.position
|
||||
const isYaxis = position === 'left' || position === 'right'
|
||||
// 先只处理竖轴
|
||||
if (field !== 'field' && field !== 'title') {
|
||||
if (field !== 'field' && field !== 'title' && !isYaxis) {
|
||||
return
|
||||
}
|
||||
const realContent = e.target.attrs.text
|
||||
@@ -1482,8 +1485,11 @@ export function configAxisLabelLengthLimit(chart, plot) {
|
||||
})
|
||||
plot.on('axis-label:mouseleave', e => {
|
||||
const field = e.target.cfg.delegateObject.component.cfg.field
|
||||
// 不分图表纵轴通过位置判断,左右为纵轴,目前仅热力图
|
||||
const position = e.target.cfg.delegateObject.component.cfg.position
|
||||
const isYaxis = position === 'left' || position === 'right'
|
||||
// 先只处理竖轴
|
||||
if (field !== 'field' && field !== 'title') {
|
||||
if (field !== 'field' && field !== 'title' && !isYaxis) {
|
||||
return
|
||||
}
|
||||
const realContent = e.target.attrs.text
|
||||
|
||||
Reference in New Issue
Block a user