1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-chart.Navigation'>/**
2 </span> * @class Ext.chart.Navigation
4 * Handles panning and zooming capabilities.
8 Ext.define('Ext.chart.Navigation', {
10 constructor: function() {
11 this.originalStore = this.store;
14 //filters the store to the specified interval(s)
15 setZoom: function(zoomConfig) {
17 store = me.substore || me.store,
19 len = store.getCount(),
20 from = (zoomConfig.x / bbox.width * len) >> 0,
21 to = Math.ceil(((zoomConfig.x + zoomConfig.width) / bbox.width * len)),
22 recFieldsLen, recFields = [], curField, json = [], obj;
24 store.each(function(rec, i) {
25 if (i < from || i > to) {
29 //get all record field names in a simple array
30 if (!recFields.length) {
31 rec.fields.each(function(f) {
32 recFields.push(f.name);
34 recFieldsLen = recFields.length;
36 //append record values to an aggregation record
37 for (i = 0; i < recFieldsLen; i++) {
38 curField = recFields[i];
39 obj[curField] = rec.get(curField);
43 me.store = me.substore = Ext.create('Ext.data.JsonStore', {
50 restoreZoom: function() {
51 this.store = this.substore = this.originalStore;
55 });</pre></pre></body></html>