【问题标题】:Apex charts disable scrolling / zoomingApex 图表禁用滚动/缩放
【发布时间】:2021-11-24 13:15:47
【问题描述】:

我已经使用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]
    ]
  }]
}

【问题讨论】:

    标签: javascript reactjs typescript apexcharts


    【解决方案1】:

    我猜你说的是选择缩放,你可以这样关闭它

    chart: {
      id: 'my-chart',
      type: 'line' as 'line',
      toolbar: {
        show: false
      },
      zoom: {
        enabled: false,
      }
    },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-31
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      • 2016-01-14
      相关资源
      最近更新 更多