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.

SfChart DragDelta value is always 0

Thread ID:

Created:

Updated:

Platform:

Replies:

118235 Feb 13,2015 03:53 PM Feb 17,2015 12:17 AM WinRT 3
loading
Tags: SfChart
Gary Montgomery
Asked On February 13, 2015 03:53 PM

SFChart with a line series. Databound to an observable collection of custom objects. Editing enabled. Chart is fixed at 5 data points. First and last point edits are cancelled inside DragStart.

I would like to enforce a constraint that points must always increase in value from left to right. When increasing a point's value, if it equals the next point to the right, then both points should increase together in parallel.

I wired up the DragStart, DragDelta and DragEnd handlers. Inside the DragDelta I thought I would compare values and update adjacent points when needed.

The current issue is that e.Delta is always zero inside DragDelta according to my debugging.  

Is my expectation wrong or is there something special I need to do to get the delta change in the DragDelta handler?

Thank you,
Gary

Rachel A [Syncfusion]
Replied On February 16, 2015 07:42 AM

Hi Gary,

Thank you for contacting Syncfusion support.

While dragging the segment, the delta value (e.Delta) in DragDelta event remains zero. We have considered this as an issue.

However this can be resolved by manually calculating the delta value, using the arguments BaseYValue and NewYValue in XYSegmentDragEventArgs (i.e., difference between base value and new value). We have prepared the sample based on your requirement and please download the sample in the below location.

Sample: Drag_Delta.zip

Also we request you to create an incident in direct trac support so that we could assist you in providing custom patch for the above mentioned issue.

Please let us know, if you need any further assistance on this.

Thanks,

Rachel. A




Gary Montgomery
Replied On February 16, 2015 06:48 PM

Thank you Rachel! That did the trick.

Here is the relevant snippet for anyone that finds this post after the zip is removed.

        private void SplineSeries_DragDelta(object sender, DragDelta e)
        {
            // get old and new y value
            double oldValue = (e as XySegmentDragEventArgs).BaseYValue;
            double newValue = (e as XySegmentDragEventArgs).NewYValue;

            double delta = 0;
            if (oldValue > newValue)
                delta = oldValue - newValue;
            else
                delta = newValue - oldValue;

             // ....
          }


Rachel A [Syncfusion]
Replied On February 17, 2015 12:17 AM

Hi Gary,

Thanks for the update.

Please let us know if you require further assistance on this.

Thanks,

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.

;