Mouse wheel support in TAChart? lazarus / 55-TAChart ---------------------------------------------------------------------- ironphil · 2011-10-02 00:26 Is it possible to intercept the mouse wheel events and make them do something in TAChart? There is no event related to the mouse wheel in the event list of a chart. Form1 has mouse wheel events but they don't seem to work when the chart has the focus. ---------------------------------------------------------------------- Ask · 2011-10-03 05:28 Added in r32641,32642. See tools demo since r32643 for an example. Mouse wheel can now be used for zooming. Please tell if you need to perform some other operation -- if it is generally useful, I shall consider implementing it. Note that you can use OnBefore/After events of a user-defined tool to implement custom mouse-wheel handling. Edit: Also added panning in r32658,r32659 ---------------------------------------------------------------------- ironphil · 2011-10-03 23:24 Thanks, it works good. With a user-defined tool I could make it do exactly what I wanted so I have no additional request for now. Thanks again, that was fast. ---------------------------------------------------------------------- wp · 2011-10-06 21:17 I find the mouse-wheel zooming with FixedPoint=false in contradiction with standard mouse wheel operation in other programs. On each mouse wheel step, the focus of the zooming action is the mouse cursor. This is a great feature, but with each step the focus point jumps into the chart center. So, it is very easy to lose track of the feature to the zoomed. It would be better if the zoomed feature would not shift upon zoom in or out. To verify this issue run the tools demo, activate the "Mouse wheel to zoom" mode, and move the mouse cursor to the point x=2, y=0 (the base of the third red bar). Rotate the mouse wheel one step away from yourself (is this up or down?) to zoom in. The third bar will jump to the center. If you want to zoom by another step you'll have to move the mouse to the chart center before doing the next mouse wheel step. If you forget to do that you will lose the third bar. Rotating back will not find it either. ---------------------------------------------------------------------- Ask · 2011-10-07 10:29 Have you enabled fixed point zooming (by setting "Fixed point" checkbox)? P.S. I remember your other threads, just do not have time now. ---------------------------------------------------------------------- wp · 2011-10-07 11:02 Ah - now it works. Shouldn't FixedPoint=true be the default then, at least for the TZoomMouseWheelTool? [Edit]: Does FixedPoint=false mean "zooming with respect to chart center"? If yes then there should not be any shift at all. ---------------------------------------------------------------------- Ask · 2011-10-09 02:22 QuoteShouldn't FixedPoint=true be the default then, at least for the TZoomMouseWheelTool? Agreed, I was over-conservative in preserving existing behavior while adding FixedPoint property. Changed in r32774. QuoteDoes FixedPoint=false mean "zooming with respect to chart center"?It means "zooming with respect to the center of the current extent". "Chart center" is probably a valid meaning too.