ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Mouse scrolling (panning) backward if axis is reversed
Posted by Alan Talbot on Dec-17-2010 21:29
The Chart::MouseUsageScroll feature (what I think of as the pan function) seems to have a bug. If I reverse the direction of the axis, panning works, but backwards. Try putting this line into zoomscrolldemoDlg.cpp at line 714:

    c->yAxis()->setReverse();

The axis reverses fine, but if you zoom in and try to pan, vertical panning is reversed (up mouse moves the chart down).

We are using ChartDirector Version 5.0.2.

  Re: Mouse scrolling (panning) backward if axis is reversed
Posted by Peter Kwan on Dec-17-2010 23:50
Hi Alan,

It is a known "behaviour" of the sample code. Because of how the sample code is currently written, the "c->yAxis()->setReverse();" should be put in line 719 of the sample code.

In sample code that comes with ChartDirector works by saving the initial y-axis scale, and using it to compute the subsequent y-axis scale after zooming and scrolling.

If you reverse the y-axis, the code would save the reversed scale, and then use it to compute the subsequent y-axis scale after zooming and scrolling. The subsequent scale would be reversed, as the original scale is reversed. There is no need to explicitly call "setReverse" for subsequent charts. If the setReverse is called in subsequent charts, the scale will be reversed twice, and this is why the scrolling is having the wrong direction.

By putting setReverse in line 719, only the initial chart is reversed, and this should solve the problem.

Hope this can help.

Regards
Peter Kwan