Change right to left rectangle fit action to match left to right zoom

52 Views Asked by At

I would like to change the right to left rectangle mouse drag functionality in a ChartXY object. By default a right to left drag will zoom out and fit all data, while showing an 'x' in the rectangle area. I would prefer this drag to simple be a zoom in, the same way as dragging left to right. This matches most other graphing libraries, and it will help people use LC without learning a new mouse interaction strategy.

Ive scoured the forums and API and surprisingly havn't found a straight forward solution. I would have expected this to be a relatively straight forward configuration change, but Im struggling to find it. Any help would be appreciated.

Thanks! Bala

Ive looked through all of the ChartXY and Xaxis and Yaxis properties and methods, and have not found anything obvious. I have looked through every form post and example I could find, with no luck.

1

There are 1 best solutions below

3
Niilo Keinänen On

If I understood right, you want the rectangle zoom interaction to work regardless of mouse direction (left to right, right to left, whatever).

Currently the direction separates the functionality to two very different interactions (zoom, fit).

There is no built-in method for achieving this right now. However, I would see this as a very simple improvement we can add and it even happens that we have a new version release shipping out tomorrow so I'll try to get this included in there.

The default behavior will be unchanged, but if user disables the built-in rectangle zoom to fit interaction (right to left) using chart.setMouseInteractionRectangleFit(false) then we can use fallback to zooming regardless of the direction.