Jump to content
JChartFX Community
  • 0

iOS suppport


rosslee
 Share

Question

Hi, I have been trying to get the charts to work on an iPhone/iPad, Apple in their infinite wisdom dislike the click event so I have been having great difficulty in getting a drill down graph to work. The tap event works just fine but the hit type is undefined (assumedly because only the click event is handled in this way), is there any work arounds that are known of or support intended to be added?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

In future builds we will attach ourselves to the touchend events on apple devices, so you will not need the detectEvent call.

This code can be placed after the chart.create call

        var userAgent = navigator.userAgent;

        var isMobile = userAgent.match(/iPhone/i) || userAgent.match(/iPod/i) || userAgent.match(/iPad/i);

        if (isMobile) {

            divHolder.addEventListener("touchend", function (evt) {

                // This will be unnecessary on future builds

                // You might still need this if you want to handle touchmove or other events

                chart1.detectEvent(evt);


                if (evt.hitType == cfx.HitType.Point)

                    alert("Series " + evt.series + " Point " + evt.point);

            }, false);

        }

Hope this helps.

 

JuanC 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...