forked from github/dataease
Merge pull request #12902 from dataease/pr@dev-v2@refactor_tooltip_trigger_area
refactor(图表): 扩大提示的触发范围 #11331 #12044 #12168
This commit is contained in:
commit
09e05f8425
@ -47,46 +47,7 @@ export class Bar extends G2PlotChartView<ColumnOptions, Column> {
|
||||
yField: 'value',
|
||||
seriesField: 'category',
|
||||
isGroup: true,
|
||||
data: [],
|
||||
interactions: [
|
||||
{
|
||||
type: 'legend-active',
|
||||
cfg: {
|
||||
start: [{ trigger: 'legend-item:mouseenter', action: ['element-active:reset'] }],
|
||||
end: [{ trigger: 'legend-item:mouseleave', action: ['element-active:reset'] }]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'legend-filter',
|
||||
cfg: {
|
||||
start: [
|
||||
{
|
||||
trigger: 'legend-item:click',
|
||||
action: [
|
||||
'list-unchecked:toggle',
|
||||
'data-filter:filter',
|
||||
'element-active:reset',
|
||||
'element-highlight:reset'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'tooltip',
|
||||
cfg: {
|
||||
start: [{ trigger: 'interval:mousemove', action: 'tooltip:show' }],
|
||||
end: [{ trigger: 'interval:mouseleave', action: 'tooltip:hide' }]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'active-region',
|
||||
cfg: {
|
||||
start: [{ trigger: 'interval:mousemove', action: 'active-region:show' }],
|
||||
end: [{ trigger: 'interval:mouseleave', action: 'active-region:hide' }]
|
||||
}
|
||||
}
|
||||
]
|
||||
data: []
|
||||
}
|
||||
|
||||
axis: AxisType[] = [...BAR_AXIS_TYPE]
|
||||
|
@ -131,7 +131,6 @@ export class BidirectionalHorizontalBar extends G2PlotChartView<
|
||||
},
|
||||
position: 'bottom'
|
||||
},
|
||||
interactions: [{ type: 'active-region' }],
|
||||
yField: ['value', 'valueExt'],
|
||||
appendPadding: getPadding(chart),
|
||||
meta: {
|
||||
|
@ -68,46 +68,7 @@ export class HorizontalBar extends G2PlotChartView<BarOptions, Bar> {
|
||||
xField: 'value',
|
||||
yField: 'field',
|
||||
seriesField: 'category',
|
||||
isGroup: true,
|
||||
interactions: [
|
||||
{
|
||||
type: 'legend-active',
|
||||
cfg: {
|
||||
start: [{ trigger: 'legend-item:mouseenter', action: ['element-active:reset'] }],
|
||||
end: [{ trigger: 'legend-item:mouseleave', action: ['element-active:reset'] }]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'legend-filter',
|
||||
cfg: {
|
||||
start: [
|
||||
{
|
||||
trigger: 'legend-item:click',
|
||||
action: [
|
||||
'list-unchecked:toggle',
|
||||
'data-filter:filter',
|
||||
'element-active:reset',
|
||||
'element-highlight:reset'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'tooltip',
|
||||
cfg: {
|
||||
start: [{ trigger: 'interval:mousemove', action: 'tooltip:show' }],
|
||||
end: [{ trigger: 'interval:mouseleave', action: 'tooltip:hide' }]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'active-region',
|
||||
cfg: {
|
||||
start: [{ trigger: 'interval:mousemove', action: 'active-region:show' }],
|
||||
end: [{ trigger: 'interval:mouseleave', action: 'active-region:hide' }]
|
||||
}
|
||||
}
|
||||
]
|
||||
isGroup: true
|
||||
}
|
||||
|
||||
async drawChart(drawOptions: G2PlotDrawOptions<Bar>): Promise<Bar> {
|
||||
|
@ -68,46 +68,7 @@ export class RangeBar extends G2PlotChartView<BarOptions, Bar> {
|
||||
xField: 'values',
|
||||
yField: 'field',
|
||||
colorField: 'category',
|
||||
isGroup: true,
|
||||
interactions: [
|
||||
{
|
||||
type: 'legend-active',
|
||||
cfg: {
|
||||
start: [{ trigger: 'legend-item:mouseenter', action: ['element-active:reset'] }],
|
||||
end: [{ trigger: 'legend-item:mouseleave', action: ['element-active:reset'] }]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'legend-filter',
|
||||
cfg: {
|
||||
start: [
|
||||
{
|
||||
trigger: 'legend-item:click',
|
||||
action: [
|
||||
'list-unchecked:toggle',
|
||||
'data-filter:filter',
|
||||
'element-active:reset',
|
||||
'element-highlight:reset'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'tooltip',
|
||||
cfg: {
|
||||
start: [{ trigger: 'interval:mousemove', action: 'tooltip:show' }],
|
||||
end: [{ trigger: 'interval:mouseleave', action: 'tooltip:hide' }]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'active-region',
|
||||
cfg: {
|
||||
start: [{ trigger: 'interval:mousemove', action: 'active-region:show' }],
|
||||
end: [{ trigger: 'interval:mouseleave', action: 'active-region:hide' }]
|
||||
}
|
||||
}
|
||||
]
|
||||
isGroup: true
|
||||
}
|
||||
|
||||
async drawChart(drawOptions: G2PlotDrawOptions<Bar>): Promise<Bar> {
|
||||
|
@ -83,13 +83,6 @@ export class Area extends G2PlotChartView<AreaOptions, G2Area> {
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'tooltip',
|
||||
cfg: {
|
||||
start: [{ trigger: 'point:mousemove', action: 'tooltip:show' }],
|
||||
end: [{ trigger: 'point:mouseleave', action: 'tooltip:hide' }]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'active-region',
|
||||
cfg: {
|
||||
|
@ -100,13 +100,6 @@ export class Line extends G2PlotChartView<LineOptions, G2Line> {
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'tooltip',
|
||||
cfg: {
|
||||
start: [{ trigger: 'point:mousemove', action: 'tooltip:show' }],
|
||||
end: [{ trigger: 'point:mouseleave', action: 'tooltip:hide' }]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'active-region',
|
||||
cfg: {
|
||||
|
@ -126,13 +126,6 @@ export class Scatter extends G2PlotChartView<ScatterOptions, G2Scatter> {
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'tooltip',
|
||||
cfg: {
|
||||
start: [{ trigger: 'point:mousemove', action: 'tooltip:show' }],
|
||||
end: [{ trigger: 'point:mouseleave', action: 'tooltip:hide' }]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user