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.axisPointer.type为‘cross’时,设置tooltip.axisPointer.label.show=false无效。 #7725

Closed
DennisHill opened this issue Feb 6, 2018 · 2 comments

Comments

@DennisHill
Copy link

DennisHill commented Feb 6, 2018

One-line summary [问题简述]

当tooltip.axisPointer.type为‘cross’时,设置tooltip.axisPointer.label.show=false无效。

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: Echarts 4.x
  • Browser version [浏览器类型和版本]: Chrome 62.0.3202.94
  • OS Version [操作系统类型和版本]: Windows 7

Expected behaviour [期望结果]

tooltip.axisPointer.label.show=false时,去掉轴上的label

ECharts option [ECharts配置项]

option = {
tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'cross',
          label: {
              show: false
          }
        },
        backgroundColor: '#fff',
        borderColor: '#52A2E7',
        borderWidth: 1,
        extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);padding:0;',
        formatter: function (params) {
          let string = '';
          string += '<div style=\'padding:10px 40px;\'>';
          let date = new Date(params[0].axisValue);
          string += '<p style=\'width:160px;text-align:center;color:black\'>' + date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds() + '</p>'
          for (let i in params) {
            string += '<p style=\'color: black;width:160px;text-align:center;margin-bottom:0;margin-top:10px;\'>';
            string += '<span style=\'display:inline-block;vertical-align:middle;' +
              'width:5px;height:0;border:1px solid ' + params[i].color + ';\'></span>';
            string += '<span style=\'display:inline-block;vertical-align:middle;' +
              'width:10px;height:10px;border-radius:10px;border:2px solid ' + params[i].color + ';\'></span>';
            string += '<span style=\'display:inline-block;vertical-align:middle;' +
              'width:5px;height:0;border:1px solid ' + params[i].color + ';\'></span>';
            string += '<span style=\'display:inline-block;vertical-align:middle;' +
              'width:110px;text-align:left;padding-left:5px;\'>' + params[i].seriesName + '</span>';
            string += '<span style=\'display:inline-block;vertical-align:middle;' +
              'width:30px;text-align:left;\'>' + params[i].value[1] + '</span>';
            string += '</p>';
          }
          string += '</div>';
          return string;
        }
      },
      color: ['#52A2E7', '#F2B63A'],
      legend: {},
      xAxis: {
        type: 'time',
        axisTick: {
          show: false  
        },
        splitLine: {
          lineStyle: {
            type: 'dashed'
          }
        },
        min: function (value) {
          return value.min - 900000;
        }
      },
      yAxis: {
        type: 'value',
        axisTick: {
          show: false  
        },
        splitLine: {
          lineStyle: {
            type: 'dashed'
          }
        }
      },
      series: [{
        name: 'test2',
        type: 'line',
        smooth: true,
        itemStyle: {
          normal: {
            opacity: 0
          },
          emphasis: {
            opacity: 1
          }
        },
        data: [{
          value: [1517881216108, '29']
        }, {
          value: [1517884816108, '7']
        }, {
          value: [1517888416108, '11']
        }, {
          value: [1517892016108, '44']
        }, {
          value: [1517895616108, '98']
        }, {
          value: [1517899216108, '76']
        }, {
          value: [1517902816108, '14']
        }, {
          value: [1517906416108, '60']
        }, {
          value: [1517910016108, '42']
        }, {
          value: [1517913616108, '45']
        }, {
          value: [1517917216108, '75']
        }, {
          value: [1517920816108, '93']
        }, {
          value: [1517924416108, '46']
        }, {
          value: [1517928016108, '1']
        }, {
          value: [1517931616108, '62']
        }, {
          value: [1517935216108, '51']
        }, {
          value: [1517938816108, '67']
        }, {
          value: [1517942416108, '14']
        }, {
          value: [1517946016108, '71']
        }, {
          value: [1517949616108, '10']
        }, {
          value: [1517953216108, '70']
        }, {
          value: [1517956816108, '96']
        }, {
          value: [1517960416108, '39']
        }, {
          value: [1517964016108, '38']
        }, {
          value: [1517967616108, '64']
        }, {
          value: [1517971216108, '94']
        }, {
          value: [1517974816108, '13']
        }, {
          value: [1517978416108, '37']
        }, {
          value: [1517982016108, '22']
        }, {
          value: [1517985616108, '6']
        }]
      }, {
        name: 'test1',
        type: 'line',
        smooth: true,
        itemStyle: {
          normal: {
            opacity: 0
          },
          emphasis: {
            opacity: 1
          }
        },
        data: [{
          value: [1517881216108, '62']
        }, {
          value: [1517884816108, '50']
        }, {
          value: [1517888416108, '45']
        }, {
          value: [1517892016108, '27']
        }, {
          value: [1517895616108, '25']
        }, {
          value: [1517899216108, '15']
        }, {
          value: [1517902816108, '94']
        }, {
          value: [1517906416108, '70']
        }, {
          value: [1517910016108, '15']
        }, {
          value: [1517913616108, '44']
        }, {
          value: [1517917216108, '19']
        }, {
          value: [1517920816108, '55']
        }, {
          value: [1517924416108, '33']
        }, {
          value: [1517928016108, '88']
        }, {
          value: [1517931616108, '77']
        }, {
          value: [1517935216108, '94']
        }, {
          value: [1517938816108, '95']
        }, {
          value: [1517942416108, '52']
        }, {
          value: [1517946016108, '46']
        }, {
          value: [1517949616108, '5']
        }, {
          value: [1517953216108, '62']
        }, {
          value: [1517956816108, '46']
        }, {
          value: [1517960416108, '30']
        }, {
          value: [1517964016108, '43']
        }, {
          value: [1517967616108, '92']
        }, {
          value: [1517971216108, '67']
        }, {
          value: [1517974816108, '90']
        }, {
          value: [1517978416108, '62']
        }, {
          value: [1517982016108, '84']
        }, {
          value: [1517985616108, '57']
        }]
      }]
}

Other comments [其他信息]

tim 20180206150848

@pissang pissang added the pending We are not sure about whether this is a bug/new feature. label Feb 6, 2018
@pissang pissang removed the pending We are not sure about whether this is a bug/new feature. label Feb 6, 2018
@fscommlx
Copy link

fscommlx commented Feb 12, 2018

我也遇到了这个问题,同求解决方案

@100pah 100pah closed this as completed in a2c5123 Feb 14, 2018
@191854169
Copy link

191854169 commented Nov 16, 2020

怎么解决的呢?

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

No branches or pull requests

5 participants