Search code examples
echarts

How to disable all interaction with specific series in echarts?


I have this chart that has couple of lines that I want to function only as visual guideline, basically just some "background visuals". I don't want to have any interaction with it. I managed to remove all clicks/highlight and everything else except it still highlighting and snapping to data points when user moves the mouse.

enter image description here


Solution

  • Adding tooltip: {show: false} to the series seems to do the trick.

    Example:

    option = {
      tooltip: {
        trigger: 'axis'
      },
      xAxis: {},
      yAxis: {},
      series: [
        {
          type: 'line',
          data: [[1, 820], [3, 932], [5, 901], [7, 934], [9, 1290], [11, 1330], [13, 1320]],
        },
        {
          type: 'line',
          data: [[0, 300], [2, 300], [4, 300], [6, 300], [8, 300], [10, 300], [12, 300]],
          silent: true,
          tooltip: {show: false}
        },
        {
          type: 'line',
          data: [[0, 600], [2, 600], [4, 600], [6, 600], [8, 600], [10, 600], [12, 600]],
          silent: true,
          tooltip: {show: false}
        },
      ]
    };