Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 折线图visualMap的bug #20685

Open
user2524001 opened this issue Jan 14, 2025 · 4 comments
Open

[Bug] 折线图visualMap的bug #20685

user2524001 opened this issue Jan 14, 2025 · 4 comments
Labels

Comments

@user2524001
Copy link

Version

5.6及所有版本

Link to Minimal Reproduction

折线图visualMap的bug

Steps to Reproduce

官网折线图demo,https://echarts.apache.org/examples/zh/editor.html?c=line-aqi,如果其中几个值非常大,折线会显示成一种颜色

Image

Current Behavior

折线图visualMap的bug

Expected Behavior

折线图visualMap的bug

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

折线图visualMap的bug

@sz-p
Copy link
Contributor

sz-p commented Jan 14, 2025

About this demo. It is not a BUG. the line showed in one color, because of the visual map defined [300 - infinite] in one color, and [0-300]in visual map at coordinat maybe just one pixel. We can't recognize it visually.

@helgasoft
Copy link

@user2524001, please provide Minimal Reproduction code, like this
not-a-bug, line colors are correct.

@user2524001
Copy link
Author

let data = [[1,10],[2,10],[3,10],[4,10],[5,10],[6,999999999]]
myChart.setOption(
(option = {
title: {
text: 'Beijing AQI',
left: '1%'
},
tooltip: {
trigger: 'axis'
},
grid: {
left: '5%',
right: '15%',
bottom: '10%',
height: 50
},
xAxis: {
data: data.map(function (item) {
return item[0];
}),
show:false
},
yAxis: {},

  visualMap: {
    top: 50,
    right: 10,
    pieces: [
      {
        gt: 0,
        lte: 50,
        color: '#93CE07'
      },
      {
        gt: 50,
        lte: 100,
        color: '#FBDB0F'
      },
      {
        gt: 100,
        lte: 150,
        color: '#FC7D02'
      },
      {
        gt: 150,
        lte: 200,
        color: '#FD0100'
      },
      {
        gt: 200,
        lte: 300,
        color: '#AA069F'
      },
      {
        gt: 300,
        color: '#AC3B2A'
      }
    ],
    outOfRange: {
      color: '#999'
    }
  },
  series: {
    name: 'Beijing AQI',
    type: 'line',
    data: data.map(function (item) {
      return item[1];
    }),
    
  }
})

);

比如这段代码,前五条数据应该展示为绿色,现在视觉上的确展示为红色了

Image

@user2524001
Copy link
Author

@helgasoft @sz-p 的确是个bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants