gypson
Posts: 1
Joined: Wed Sep 20, 2023 3:02 pm

I want to completely disable zooming

Wed Sep 20, 2023 3:08 pm

I am currently using React HighCharts. I have looked through the documentation and have yet to completely disable zooming.

This is my current config:

Code: Select all

{
  chart: {
    type: "scatter",
    width: null,
    height: null,
    reflow: true,
    zooming: {
        type: null,
        pinchType: null,
    },
  },
  title: {
    text: null,
  },
  xAxis: {
    title: {
      text: KPI_OPTIONS[xAxisKpi].label,
      style: { ...scatterPlotStyles.labels },
      margin: 32,
    },
    lineWidth: 2,
    lineColor: theme.palette.grey[800],
    gridLineWidth: 0,
    tickWidth: 0,
    labels: {
      enabled: false,
    },
    zoomEnabled: false,
  },
  yAxis: {
    title: {
      text: KPI_OPTIONS[yAxisKpi].label,
      style: { ...scatterPlotStyles.labels },
      margin: 32,
    },
    lineWidth: 2,
    lineColor: theme.palette.grey[800],
    gridLineWidth: 0,
    tickWidth: 0,
    labels: {
      enabled: false,
    },
    zoomEnabled: false,
  },
  legend: {
    enabled: false,
  },
  credits: {
    enabled: false,
  },
  tooltip: {
    enabled: false,
  },
  plotOptions: {
    series: {
      states: {
        hover: {
          enabled: false,
        },
        inactive: {
          opacity: 1,
        },
      },
      marker: {
        states: {
          hover: {
            enabled: false,
            halo: {
              size: 0,
            },
          },
        },
      },
    },
  },
  series: [...series],
}

kamil.k
Posts: 404
Joined: Thu Oct 06, 2022 12:49 pm

Re: I want to completely disable zooming

Thu Sep 21, 2023 8:19 am

Hello gypson!

Welcome to our forum and thanks for contacting us with your question.

Zooming can be enabled in both of our products, Highcharts Core, and Highcharts Stock, but note that it's disabled by default. Here you can read more about the zooming functionality: https://www.highcharts.com/docs/chart-concepts/zooming.

I've debugged your config, and it doesn't seem to enable zooming. What I'd suggest first is to remove the chart.zooming property completely, and check if themouse-wheel-zoom module isn't implemented as it doesn't need any options applied to enable zooming on scroll (alternatively, use the chart.zooming.mouseWheel.enabled property set to false).

If the above doesn't help, can you please be more specific, and provide more information about how the zooming works in your case?

Looking forward to your response,
Kind Regards!
Kamil Kubik
Highcharts Developer

Return to “Highcharts Usage”