Search code examples
delphidragteechart

Click/drag panning with TDBChart/ TChart


is there any way to implement a draggable TChart which pans/ moves on click and drag? At the moment it is zooming to the area selected; can this be changed to work like you'd expect on a touch screen? Thanks, Toby


Solution

  • By default, zooming is active and set to be used drawing a zooming rectangle with the left mouse button. And the scroll is set to be used dragging the chart with the right mouse button.
    To change this behaviour, you can disable the zooming and change the scroll button:

      Chart1.Zoom.Allow:=false;
      Chart1.ScrollMouseButton:=mbLeft;