57453

Scroll chart with mouse wheel in TeeChart

Question:

Default way to scroll chart is to drag mouse holding right button. I need to scroll with mouse wheel. I haven't found any API to enable/disable mouse wheel scrolling.

I also tried to add MouseWheelListener to the chart itself, but it never gets called.

Is it possible to use mouse wheel in TeeChart lib?

My application is Eclipse RCP using SWT.

Answer1:

The following code works fine for me with TeeChart Java SWT in Eclipse:

Bar bar1 = new Bar(tChart1.getChart()); bar1.fillSampleValues(); tChart1.addMouseWheelListener(new MouseWheelListener() { @Override public void mouseScrolled(MouseEvent arg0) { Axis tmpA = tChart1.getAxes().getLeft(); double tmpInc = tmpA.getRange()/10; if (arg0.count>0) tmpA.setMinMax(tmpA.getMinimum()+tmpInc, tmpA.getMaximum()+tmpInc); else tmpA.setMinMax(tmpA.getMinimum()-tmpInc, tmpA.getMaximum()-tmpInc); } });

Recommend

  • The best alternative of Math.pow in J2ME
  • Git Configuration with eclipse--not able to push code from eclipse to remote git server
  • Eclipse code fomatting
  • android-maven-plugin 3.8.2 not covered by lifecycle
  • Why can't I create PHP project using Eclipse Juno?
  • How to find problematic thread in Eclipse remote debugger?
  • How to alias an executable using Powershell permanently?
  • Starting Android AVD crashes with java.awt.HeadlessException
  • How to import Navit into Eclipse and use it in own android project
  • ZipResourceFile cannot be resolved to a type
  • Unable to run SDL program in Eclipse but able to do so in Windows Explorer
  • How to resolve dependencies from one gradle project to another gradle project in my Eclipse workspac
  • Wrapping text in spinner android
  • Any nice way to generate a timeline view of commits from subversion?
  • Local Development, Apache vs Developer - file permissions
  • How to get latest version of a artifact on Bintray using JSONP
  • During installation of Django, why do I keep getting ImportError: No module named django?
  • error importing numpy
  • Very simple C++ DLL that can be called from .net
  • C# - Serializing and deserializing static member
  • How to recover from a Spring Social ExpiredAuthorizationException
  • Sending data from AppleScript to FileMaker records
  • ILMerge & Keep Assembly Name
  • Large data - storage and query
  • How can I estimate amount of memory left with calling System.gc()?
  • WOWZA + RTMP + HTML5 Playback?
  • How to get icons for entities from eclipse?
  • How to include full .NET prerequisite for Wix Burn installer
  • How to set the response of a form post action to a iframe source?
  • Hits per day in Google Big Query
  • Angular 2 constructor injection vs direct access
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Java static initializers and reflection
  • Android Google Maps API OnLocationChanged only called once
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • Is it possible to post an object from jquery to bottle.py?
  • unknown Exception android
  • UserPrincipal.Current returns apppool on IIS
  • java string with new operator and a literal