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

大数据 折线图 tooltip 不显示 数据为0时候渲染不正确 #3460

Closed
songguangyu opened this issue Jun 20, 2016 · 4 comments
Closed
Labels
inactive Not active for some time or no response from the author. Will be closed soon.

Comments

@songguangyu
Copy link

问题简述 (One-line summary)

大数据 折线图 tooltip 不显示 数据为0时候渲染不正确

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):
  • 浏览器类型和版本 (Browser version):
  • 操作系统类型和版本 (OS Version):

ECharts 3.0

chrome 51.0.2704.84 (64-bit)

mac os

重现步骤 (Steps to reproduce)

  1. 数据都为0 但是图渲染的不正确
    2.tooptip 怎么设置都不能显示出来
    看了一下 那个div是空的

期望结果 (Expected behaviour)

tooptip 能显示 数据为0 的时候什么都不现实

可能哪里有问题 (What went wrong)

ECharts配置项 (ECharts option)

var option = {
          tooltip: {
            show: true
          },
          title: {
              left: 'center',
              text: '大数据量折线图',
          },
          legend: {
              top: 'bottom',
              data:['意向']
          },
          toolbox: {
              show: true,
              feature: {
                  dataView: {show: true, readOnly: false},
                  magicType: {show: true, type: ['line', 'bar', 'stack', 'tiled']},
                  restore: {show: true},
                  saveAsImage: {show: true}
              }
          },
          xAxis: {
              type: 'category',
              boundaryGap: false,
              data: date
          },
          yAxis: {
              type: 'value',
              boundaryGap: [0, '100%']
          },
          series: [
              {
                  name:'模拟数据',
                  type:'line',
                  smooth:true,
                  symbol: 'none',
                  sampling: 'average',
                  itemStyle: {
                      normal: {
                          color: 'rgba(255, 70, 131,0)'
                      }
                  },
                  areaStyle: {
                      normal: {
                          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                              offset: 0,
                              color: 'rgb(255, 158, 68)'
                          }, {
                              offset: 1,
                              color: 'rgb(255, 70, 131)'
                          }])
                      }
                  },
                  data: data
              }
          ]
      };

其他信息 (Other comments)

image

@songguangyu
Copy link
Author

this.state.myChart.setOption({
series: {
data: data.data.bandwidth
},
xAxis:{
data: data.data.datetime
}
});

重新 set 的时候才会 出现问题

@realeve
Copy link

realeve commented Jun 20, 2016

1.你贴的option跑不起来,请贴完整代码。
下面是我简单改过的一个:

var data = [];
var date = [];
for (var i = 1; i < 20; i++) {
    date.push(i);
    data.push(0);
}

var option = {
          tooltip: {},
          xAxis: {
              type: 'category',
              boundaryGap: false,
              data: date
          },
          yAxis: {
              type: 'value'
          },
          series: [
              {
                  name:'模拟数据',
                  type:'line',
                  //symbol: 'none',
                  itemStyle: {
                      normal: {
                          color: 'rgb(255, 0, 0)'
                      }
                  },
                  data: data
              }
          ]
      };

2.数据都为0 但是图渲染的不正确
这里用的是面积图,从0轴到最终的数据生成面积,面积为0的时候,就是一条线了,生成的线由于颜色透明度为0,所以其实是透明的。
color: 'rgba(255, 70, 131,0)'

3.tooptip 怎么设置都不能显示出来 看了一下 那个div是空的
因为你在系列中设置了symbol: 'none',

image

@songguangyu
Copy link
Author

可以 出来了,非常感谢 ,我不写tooltip: {
trigger: 'axis',
position: function (pt) {
return [pt[0], '10%'];
}
}
的话 提示就没有 , 写了才有 但是不是应该默认出提示吗?

@echarts-bot
Copy link

echarts-bot bot commented Jul 1, 2019

This issue is closed due to not being active. Please feel free to open it again (for the author) or create a new one and reference this (for others) if you have further questions.

@Ovilia Ovilia added the inactive Not active for some time or no response from the author. Will be closed soon. label Jul 1, 2019
@echarts-bot echarts-bot bot closed this as completed Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive Not active for some time or no response from the author. Will be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants