score:5

Accepted answer

to follow up for folks reading this question and its answers, the issue with scrolling and highcharts visualizations was resolved with version 3.0.1 (2013-04-09). highstock, a sibling of highcharts, received a similar update with version 1.3.1 (2013-04-09).

added new option, tooltip.followtouchmove. when this is true, the tooltip can be moved by dragging a single finger across the chart, like in highcharts 2. when it is false, dragging a single finger is ignored by the chart, and causes the whole page to scroll. this applies only when zooming is not enabled.

further enhancements were made in highcharts version 4.1.0 (2015-02-16):

made tooltip.followtouchmove true by default, and allowed page scroll at the same time.

for the complete highcharts change log, see http://www.highcharts.com/documentation/changelog.

score:1

the problem is caused by highcharts capturing all touch events and making them do nothing. i solved this by basically just overlaying a div over the chart area on mobile devices and preventing those events from reaching highcharts elements (so they are free to trigger default behavior, i.e. page scrolling). i used this js (assuming you are also using jquery or equivalent):

$('.highcharts-container').each(function() {
  var draghandle;
  draghandle = $('<div class="chart-drag-handle">');
  $(this).append(draghandle);
  draghandle.on('touchstart', function(e) {
    e.stoppropagation();
  });
  draghandle.on('touchmove', function(e) {
    e.stoppropagation();
  });
  draghandle.on('touchend', function(e) {
    e.stoppropagation();
  });
  draghandle.on('touchcancel', function(e) {
    e.stoppropagation();
  });
});

the elements added would need to be styled to overlay the chart, i did that like so:

.highcharts-container .chart-drag-handle {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  z-index: 100;
}

score:19

try this link .... just make a separate javascript file ,copy paste the code and include the file


Related Query

More Query from same tag