New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3d scatter demo is broken on touch devices #6784

Closed
blackChef opened this Issue Jun 1, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@blackChef

blackChef commented Jun 1, 2017

  • There's no touchdrag event, this should be touchmove I believe.

       $(document).on({
          'mousemove.hc touchdrag.hc': function (e) {...
    
  • Touch events don't have pageX or pageY. I believe we are supposed to use chartX chartY instead. Otherwise chart.pointer.normalize(eStart) would be pointless.

     eStart = chart.pointer.normalize(eStart);
    
     var posX = eStart.pageX,
         posY = eStart.pageY,
         alpha = chart.options.chart.options3d.alpha,
         beta = chart.options.chart.options3d.beta,
         newAlpha,
         newBeta,
         sensitivity = 5; // lower is more sensitive
    
     $(document).on({
         'mousemove.hc touchdrag.hc': function (e) {
             // Run beta
             newBeta = beta + (posX - e.pageX) / sensitivity;
             chart.options.chart.options3d.beta = newBeta;
    

Expected behaviour

Actual behaviour

Live demo with steps to reproduce

Affected browser(s)

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Jun 2, 2017

Contributor

Thank you for reporting this issue! You are right it doesn't work with current config on touch devices, working example: http://jsfiddle.net/7k4a026x/

Contributor

pawelfus commented Jun 2, 2017

Thank you for reporting this issue! You are right it doesn't work with current config on touch devices, working example: http://jsfiddle.net/7k4a026x/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment