amcharts / amcharts5

The newest, fastest, and most advanced amCharts charting library for JavaScript and TypeScript apps.
Other
359 stars 96 forks source link

Bug panning and pinch in mobile #1734

Open shishima123 opened 2 months ago

shishima123 commented 2 months ago

The panning feature has issues on mobile; it gets interrupted when I try to pan on both the x and y axes.

Additionally, when I set up the pinch feature with the pinchZoomX option, it works fine. However, with pinchZoomY, every time you touch the screen with two fingers, it automatically zooms in. When you touch the screen with two fingers again, it returns to its original state.

My device:

https://github.com/user-attachments/assets/e071ef14-ee71-4089-9c7d-6ee2720ddb6e

martynasma commented 2 months ago

Have you tried disabling auto-zoom?

https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Dynamic_min_max

shishima123 commented 2 months ago

yes, i tried

my setting


am5stock.StockPanel.new(root, {
  wheelY: 'zoomXY',
  panX: true,
  panY: true,
  wheelZoomPositionX: null,
  wheelZoomPositionY: null,
  pinchZoomX: true
  // pinchZoomY: true
})

valueAxis = mainPanel.yAxes.push(
  am5xy.ValueAxis.new(root, {
    autoZoom: false,
    renderer: am5xy.AxisRendererY.new(root, {
      minorGridEnabled: false,
      pan: 'zoom',
      panSensitivity: 2
    }),
    tooltip: am5.Tooltip.new(root, {
      autoTextColor: false
    }),
    numberFormat: '#,###',
    paddingRight: 15,
    maxPrecision: 0,
    maxDeviation: 0
  })
)
martynasma commented 2 months ago

Thanks.

We'll need to investigate this. Will get back to you when we have something.