Skip to content
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
Closed

3d scatter demo is broken on touch devices #6784

blackChef opened this issue Jun 1, 2017 · 1 comment

Comments

@blackChef
Copy link

@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
Copy link
Contributor

@pawelfus 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.