You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/zooming.md
+90-92Lines changed: 90 additions & 92 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,70 +5,76 @@ sidebar_label: "Zooming"
5
5
6
6
# Zooming
7
7
8
-
9
8
dhtmlxGantt provides a built-in module for handy managing of time scale zooming. In case you want to customize the default zooming behaviour, there is a [flexible API](guides/zoom.md) that allows you to implement the ability to change the settings of time scale dynamically.
10
9
11
10
## Built-in zooming module
12
11
13
-
14
-
The embedded [zooming module](guides/zoom.md) is declared in the **gantt.ext.zoom** extension. To enable the module, you need to call **gantt.ext.zoom.init(zoomConfig)** and pass
15
-
a **zoomConfig** object with configuration settings that contains an array of zooming levels. For example:
12
+
The embedded [zooming module](guides/zoom.md) is declared in the `gantt.ext.zoom` extension. To enable the module, you need to call `gantt.ext.zoom.init(zoomConfig)` and pass
13
+
a `zoomConfig` object with configuration settings that contains an array of zooming levels. For example:
In case you don't want to use the zooming module and prefer controlling scale settings manually, you can do so via corresponding configuration options.
90
93
91
94
In fact, implementing a zooming feature means defining several presets of the time scale configuration (zoom levels) and providing the user with the ability to switch between them.
92
95
93
96
You'll need the following settings to configure the time scale:
94
97
95
-
-[gantt.config.scales](api/config/scales.md) - allows setting any number of time scale rows.
96
-
97
-
-[gantt.config.min_column_width](api/config/min_column_width.md), [gantt.config.scale_height](api/config/scale_height.md) - the scale column width and the overall height of the time scale.
98
+
-[`gantt.config.scales`](api/config/scales.md) - allows setting any number of time scale rows
99
+
-[`gantt.config.min_column_width`](api/config/min_column_width.md), [`gantt.config.scale_height`](api/config/scale_height.md) - the scale column width and the overall height of the time scale
98
100
99
101
Let's consider the following presets:
100
102
101
103
~~~js
102
104
/* global gantt */
103
-
functionsetScaleConfig(level) {
105
+
constsetScaleConfig=(level)=> {
104
106
switch (level) {
105
107
case"day":
106
108
gantt.config.scales= [
107
-
{unit:"day", step:1, format:"%d %M"}
109
+
{ unit:"day", step:1, format:"%d %M"}
108
110
];
109
111
gantt.config.scale_height=27;
110
112
break;
111
-
case"week":
112
-
varweekScaleTemplate=function(date) {
113
-
var dateToStr=gantt.date.date_to_str("%d %M");
114
-
var endDate =gantt.date.add(gantt.date.add(date, 1, "week"), -1, "day");
0 commit comments