Apex 图表禁用滚动/缩放

And*_*zo1 0 javascript typescript reactjs apexcharts

我已经使用ApexCharts库构建了一个图表,并且我想禁用拖动图表的可能性。我应该如何更新我的配置(见下文)?我在文档中找不到任何详细信息。这是我的图表:

//My component
<Chart
  options={performanceLineChart.options}
  series={performanceLineChart.series}
/>

//My configurations
export const performanceLineChart = {
  options: {
    chart: {
      id: 'my-chart',
      type: 'line' as 'line',
      toolbar: {
        show: false //Disable toolbar
      }
    },
    stroke: {
      width: 5,
      curve: 'smooth' as 'smooth'
    },
    markers: {
      size: 4,
      hover: {
        size: undefined,
        sizeOffset: 2
      }
    },
    xasis: {
      type: 'numeric',
    }
  },
  series: [{
    name: 'Line 1',
    data: [
      [3066, 323],
      [6317, 312],
      [12498, 313],
      [24091, 326]
    ]
  },{
    name: 'Line 2',
    data: [
      [3516, 281],
      [7378, 268],
      [11502, 344],
      [21219, 371]
    ]
  }]
}
Run Code Online (Sandbox Code Playgroud)

Pat*_*zuk 5

我猜你正在谈论选择缩放,你可以像这样关闭它

chart: {
  id: 'my-chart',
  type: 'line' as 'line',
  toolbar: {
    show: false
  },
  zoom: {
    enabled: false,
  }
},
Run Code Online (Sandbox Code Playgroud)