ChartDirector 7.1 (C++ Edition)

QChartViewer.setZoomDirection


Usage

void setZoomDirection(int direction);

Description

Sets the zoom direction for mouse zoom in/out actions.

In zoom operations for charts, it is common to restrict zooming to one direction only. For example, in a chart plotting temperature against time, zooming in from a yearly chart to a daily chart may mean the time axis (x-axis) is zoomed in by 36500%, while the temperature axis (y-axis) may be auto-scaled and not zoomed in at all. The user may be surprise if you also zoom in the y-axis by 36500%, in which case the chart may become hardly readable.

This method allows you to determine the zoom direction for mouse zoom actions (see QChartViewer.setMouseUsage), specified using the following predefined constants:

ConstantValueDescription
DirectionHorizontal0Zoom actions apply to horizontal direction only.
DirectionVertical1Zoom actions apply to vertical direction only.
DirectionHorizontalVertical2Zoom actions apply to both horizontal and vertical directions.
KeepAspectRatio3Zoom actions apply to both horizontal and vertical directions and with the same ratio.

Arguments

ArgumentDefaultDescription
direction(Mandatory)The zoom direction for mouse zoom actions.

Return Value

None