extjs - Crosszoom in a sencha chart with inner padding -


i have sencha chart crosszooming , innerpadding 1 in fiddle. problem i'm experiencing is not possible pull rectangle of cross zoom completly down x-axis , right side of chart. when remove innerpadding of chart works fine.

https://fiddle.sencha.com/#fiddle/mh8

is there workaround problem?

i've forked fiddle fix, here: https://fiddle.sencha.com/#fiddle/mih

note: question tagged touch2.1 fiddle in 2.4.1

when define innerpadding, innerregion chart calculated based on padding. excerpt source of cartesianchart

shrinkbox.left += innerpadding.left;             shrinkbox.top += innerpadding.top;             shrinkbox.right += innerpadding.right;             shrinkbox.bottom += innerpadding.bottom;              innerwidth = width - innerpadding.left - innerpadding.right;             innerheight = height - innerpadding.top - innerpadding.bottom;              me.setinnerregion([shrinkbox.left, shrinkbox.top, innerwidth, innerheight]); 

now inside ongesture (protected function) handler of crosszoom, checks innerregion of chart , if current x or y greater width or height (you innerregion of chart) of chart respectively, it's reset width/height of chart (width , height ). thus, limited inside padded area.

is there workaround problem?

you can work around overriding behavior, it's expected behavior far sencha concerned.

override ongesture function of crosszoom takes padding offset consideration.

//ongesture implementation in crosszoom

    ongesture: function (e) {     var me = this;     if (me.zoomanimationinprogress) {         return;     }     if (me.getlocks()[me.getgesture()] === me) {         var chart = me.getchart(),             surface = me.getsurface(),             region = chart.getinnerregion(),             chartwidth = region[2],             chartheight = region[3],             xy = chart.element.getxy(),             x = e.pagex - xy[0] - region[0],             y = e.pagey - xy[1] - region[1];          if (x < 0) {             x = 0;         } else if (x > chartwidth) {             x = chartwidth; // limits in x-axis         }         if (y < 0) {             y = 0;         } else if (y > chartheight) {             y = chartheight; // limits in y-axis         }         me.selectionrect.setattributes({             width: x - me.startx,             height: y - me.starty         });         if (math.abs(me.startx - x) < 11 || math.abs(me.starty - y) < 11) {             me.selectionrect.setattributes({globalalpha: 0.5});         } else {             me.selectionrect.setattributes({globalalpha: 1});         }         surface.renderframe();         return false;     } } 

refer source code more details , understanding.

fyi: may again have question cannot start drawing crosszoom overlay outside padding region. check ongesturestart, if asking question.


Comments