Project

General

Profile

WCartesianChart disable pan/zoom for axis

Added by Ulf Johnsson over 3 years ago

Hi.

Is it possible do disable Pan/Zoom for individual WAxis?
I have a project were I want the Y-axis to be pannable/zoomable, but I want the x-axis to be static.

setMinimumZoomRange()
setMaximumZoomRange();

Kind of works, but not quite, they still seem to be slightly movable.

BR, Ulf


Replies (4)

RE: WCartesianChart disable pan/zoom for axis - Added by Roel Standaert over 3 years ago

Does setMaxZoom(1.0) work better, maybe? I know it's marked as deprecated, but I think we may just remove that deprecation warning, since I too keep finding good uses for it.

RE: WCartesianChart disable pan/zoom for axis - Added by Ulf Johnsson over 3 years ago

Yes, that seems to do the trick, thank you.
I will try it out further and see If I can solve my issues using that system.

RE: WCartesianChart disable pan/zoom for axis - Added by Ulf Johnsson over 3 years ago

Hmm, that indeed disbles the pan/zoom, but it poses a different problem for me.

I am trying to disable so that the end user (browser side) cannot pan zoom, using the mouse/touch-screen and so on, but I want to control the range programatically.
Say that the inital x-axis range is 0-10 and when the user clicks a button I want it to "zoom in" on a differnt range, like 3-5.

Would this be possible, really having trouble getting this to work.

RE: WCartesianChart disable pan/zoom for axis - Added by Roel Standaert over 3 years ago

I think a workaround could be to set zoom(), minZoom() and maxZoom() together to the same value?

At the moment when you zoom inside of the chart area that will indeed zoom all of the axes, there's no interface at the moment that allows you to specify which axes it will affect.

    (1-4/4)