This is a migrated thread and some comments may be shown as answers.

Scrolling A Page With A Chart

1 Answer 26 Views
Chart for HTML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stephen
Top achievements
Rank 1
Stephen asked on 02 Dec 2013, 06:53 PM
I have a page I've placed a chart on that pans horizontally. However, when the user touches on the chart with the intent of scrolling the page, the page does not scroll.

I've tried a combination of approaches to disable whatever is occurring in the chart to prevent the default behavior. I've set the "-ms-touch-action" css property on the div.k-chart to "none." I've tried a shotgun approach of calling the jQuery.off() method on all elements in the chart to remove any event handlers that might be preventing the default scrolling behavior, but none of this works.

Is there a way to prevent the chart from taking over the touch/scroll events?

Thanks,
Steve

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Yankov
Telerik team
answered on 03 Dec 2013, 09:42 AM
Hello Stephen,

Thank you for contacting us.

Setting the "-ms-touch-action" css property to "none" prevents the behavior you desire. It forces the element to ignore touch interactions on itself. Try setting the "-ms-touch-action" property value to "pan-x". This should enable horizontal panning for the element and the panning will be executed on the first parent that has horizontal scrollable content.

Note that on Windows 8.1 HTML apps use IE11 for rendering and in IE11 the "-ms-touch-action" property is no longer supported. You should use "touch-action" instead.
div.k-chart {
    -ms-touch-action: pan-x;
    touch-action: pan-x;
}

I hope this is helpful. In case of any further problems or questions do not hesitate to ask.

Regards,
Martin Yankov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart for HTML
Asked by
Stephen
Top achievements
Rank 1
Answers by
Martin Yankov
Telerik team
Share this question
or