Skip to content

[Bug] tooltip does not shown when tooltip.trigger is axis in line chart,it is OK while tooltip.trigger is item #17496

@DetectiveBox

Description

@DetectiveBox

Version

^5.3.3

Link to Minimal Reproduction

No response

Steps to Reproduce

  1. set tooltip.trigger axis
  2. mouse move enter chart
  3. the line shown but tooltip is not shown

Current Behavior

option = {
title: {
show: false,
},
legend: {
data: ['百度', '谷歌'],
show: true,
selectedMode: true,
top: 'top',
right: 0,
orient: 'vertical',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: "line"
},
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value',
},
series: [
{
name: '百度',
data: [65, 78, 130, 65, 56, 73, 89],
type: 'line',
smooth: true,
itemStyle: {
// 折线的颜色
color: 'rgb(249,120,69,1)',
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(249,120,69,0.8)',
},
{
offset: 1,
color: 'rgba(249,120,69,0.3)',
},
]),
},
},
{
name: '谷歌',
data: [65, 56, 123, 36, 32, 69, 78],
type: 'line',
smooth: true,
itemStyle: {
// 折线的颜色
color: 'rgba(58,77,233,1)',
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(58,77,233,0.8)',
},
{
offset: 1,
color: 'rgba(58,77,233,0.3)',
},
]),
},
},
],
}

Expected Behavior

option = {
title: {
show: false,
},
legend: {
data: ['百度', '谷歌'],
show: true,
selectedMode: true,
top: 'top',
right: 0,
orient: 'vertical',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: "line"
},
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value',
},
series: [
{
name: '百度',
data: [65, 78, 130, 65, 56, 73, 89],
type: 'line',
smooth: true,
itemStyle: {
// 折线的颜色
color: 'rgb(249,120,69,1)',
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(249,120,69,0.8)',
},
{
offset: 1,
color: 'rgba(249,120,69,0.3)',
},
]),
},
},
{
name: '谷歌',
data: [65, 56, 123, 36, 32, 69, 78],
type: 'line',
smooth: true,
itemStyle: {
// 折线的颜色
color: 'rgba(58,77,233,1)',
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(58,77,233,0.8)',
},
{
offset: 1,
color: 'rgba(58,77,233,0.3)',
},
]),
},
},
],
}

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

When I put the option configuration in this https://echarts.apache.org/examples/zh/editor.html?c=line-stack&version=5.3.3, it works OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions