We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Trackball behavior on touch events in UWP

Thread ID:

Created:

Updated:

Platform:

Replies:

124324 May 31,2016 05:43 PM Jun 2,2016 11:09 AM UWP 4
loading
Tags: SfChart
Jason Traud
Asked On May 31, 2016 05:43 PM

The end product of my solution is going to be primarily used on a touch first device.  I have live streaming data on a chart and would like to be able to take advantage of the interactive trackball that I can manipulate by hovering with the mouse.

Is it possible to invoke this with a touch event?

Rachel A [Syncfusion]
Replied On June 1, 2016 01:05 AM

Hi Jason, 
 
Thanks for contacting Syncfusion support. 
 
SfChart provides interactive trackball feature, which supports for touch input devices also.  
 
You can refer the below UG documentation to know more information on trackball. 


Note: We don’t need to invoke the trackball explicitly. 
 
Also if this is not your requirement and if you have any specific requirement in trackball related with events, please revert us with more information. So that we can provide you a better solution. 
 
Regards, 
Rachel. A 


Jason Traud
Replied On June 1, 2016 09:52 AM

Rachel, 

Thank you for your reply. I've been using this reference and have it working, but only with a mouse hover. I'm doing this all in C# and I'm not using XAML. I've pasted my current configuration code below. Is there something I'm missing that may be preventing this from working with touch? When testing with the touch screen on my laptop the pinch and zoom events work when the ChartZoomPanBehavior block is not commented out.  I've been keeping this commented out just in case the touch events for zooming conflicted with the trackball. 

If the trackball behavior just won't work with touch, is it possible to have the call-out being set by a button? The data I'm displaying is a 0 to 1024 range. I can see it being acceptable to use a slider or a button to set the highlighted trackball point on the x-axis.

[code]            //SfChart chart = new SfChart();  // Defined as a global in MainPage.xaml.cs
            chart.Height = 300;
            chart.VerticalAlignment = VerticalAlignment.Top;

            Thickness chartMargin = new Thickness(20);
            chart.Margin = chartMargin;

            /*
            ChartZoomPanBehavior behavior = new ChartZoomPanBehavior();
            behavior.EnableZoomingToolBar = true;
            behavior.ToolBarItems = ZoomToolBarItems.All;
            behavior.HorizontalPosition = HorizontalAlignment.Left;
            behavior.VerticalPosition = VerticalAlignment.Top;
            behavior.ToolBarOrientation = Orientation.Horizontal;
            behavior.EnableSelectionZooming = true;
            chart.Behaviors.Add(behavior); */          

            ChartTrackBallBehavior trackballvisible = new ChartTrackBallBehavior();
            trackballvisible.UseSeriesPalette = true;
            chart.Behaviors.Add(trackballvisible);

            CategoryAxis primaryAxis = new CategoryAxis();
            primaryAxis.Header = "Pixel";
            primaryAxis.ShowTrackBallInfo = true;
            primaryAxis.ShowGridLines = true;
            chart.PrimaryAxis = primaryAxis;
            NumericalAxis secondaryAxis = new NumericalAxis();
            secondaryAxis.Maximum = 4096;
            secondaryAxis.Header = "Intensity";
            chart.SecondaryAxis = secondaryAxis;

            series1.ItemsSource = this.Values;
            series1.XBindingPath = "pixel";
            series1.YBindingPath = "intensity";
            chart.Series.Add(series1);

            series1.ListenPropertyChange = true;
            this.MainGrid.Children.Add(chart);
        }[/code]

Jason Traud
Replied On June 1, 2016 10:05 AM

I think I see where the issue is. Tapping an holding on a static chart will pull up the trackball but when I have data streaming it won't do this. 

Is there a way to programatically set the highlighted data point by the trackball? Or even have the selection remain after a tap or a mouse click?

Rachel A [Syncfusion]
Replied On June 2, 2016 11:09 AM

Hi Jason, 
 
Thanks for the update. 
 
The Trackball can be moved using touch and hold in touch devices but it is not working with real time update in UWP winrt(tablet) and works fine for phone .We have logged internally an issue report as the trackball is not moving properly when there is live data update. If you require fix for this issue, please log in to create new incident.  
 
 
We can achieve also this requirement by moving the trackball using the button click event. We have prepared the sample for your reference and you can download from the following location. 
 
 
Regards, 
Rachel. A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;