Navigate plugin - only horizontal scrolling and no zooming

1,513 views
Skip to first unread message

sam

unread,
Feb 24, 2011, 1:15:31 AM2/24/11
to Flot graphs
Hi,

I want my flot chart to scroll only horizontally, not vertically.
Also, I don't want zooming features. zooming feature should be turned
off. Is this possible with Navigate plugin?

oughton

unread,
Feb 24, 2011, 6:09:32 PM2/24/11
to Flot graphs
Yes.

Use these options:

zoom: {
interactive: false
},
pan: {
interactive: true
},
yaxis: {
panRange: [Your ymin, your ymax]
}

From the doc:

Options:

zoom: {
interactive: false
trigger: "dblclick" // or "click" for single click
amount: 1.5 // 2 = 200% (zoom in), 0.5 = 50% (zoom out)
}

pan: {
interactive: false
}

xaxis, yaxis, x2axis, y2axis: {
zoomRange: null // or [number, number] (min range, max range)
panRange: null // or [number, number] (min, max)
}

"interactive" enables the built-in drag/click behaviour. "amount" is
the amount to zoom the viewport relative to the current range, so 1 is
100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is 70% (zoom out).

"zoomRange" is the interval in which zooming can happen, e.g. with
zoomRange: [1, 100] the zoom will never scale the axis so that the
difference between min and max is smaller than 1 or larger than 100.
You can set either of them to null to ignore.

"panRange" confines the panning to stay within a range, e.g. with
panRange: [-10, 20] panning stops at -10 in one end and at 20 in the
other. Either can be null.

Ole Laursen

unread,
Mar 10, 2011, 11:28:53 AM3/10/11
to flot-...@googlegroups.com, sam
2011/2/24 sam <savan_...@persistent.co.in>:

> I want my flot chart to scroll only horizontally, not vertically.
> Also, I don't want zooming features. zooming feature should be turned
> off. Is this possible with Navigate plugin?

For the record, I just landed a patch to limit the panRange and
zoomRange so you can turn it off completely on one axis.


Ole

shailesh singh

unread,
Jun 4, 2013, 6:08:01 PM6/4/13
to flot-...@googlegroups.com, sam, ol...@iola.dk
Hi Ole, how do you disable panRange and zoomRange completely in one axis?

dnschnur

unread,
Jun 5, 2013, 7:46:15 AM6/5/13
to flot-...@googlegroups.com, sam, ol...@iola.dk
Set the value to 'false' to disable panning/zooming on that axis.

Reply all
Reply to author
Forward
0 new messages