ViewXY: Panning when fully zoomed out

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

ViewXY: Panning when fully zoomed out

Post by greggorob64 » Wed Jul 23, 2014 1:18 pm

I've been having issues trying to get my chart to disable panning when the chart is 'fully zoomed out' (i have internal values to what defines fully 'zoomed out'. The only way i could accomplish my task was using the 'before panning' event, and cancel is my chart ranges matched the fully 'zoomed out' range.

Since my latest update, it seems the 'beforepanning' method parameters have changed, and I can't cancel the pan!

What do i do from here?

Thanks

Code: Select all

//new
      void ViewXY_BeforePanning(List<RangeInfo> xRanges, List<RangeInfo> yRanges)
      {
           // no cancel!
      }

      //old
      void ViewXY_BeforePanning(List<RangeChangeInfo> xRanges, List<RangeChangeInfo> yRanges, ref bool cancel)
      {
         try
         {
            var range = xRanges.First();
            if (range.OldMax.EqualsWithThreshold(this.XAxisMaximumValue) && range.OldMin.EqualsWithThreshold(this.XAxisMinimumValue))
            {
               cancel = true;
            }
         }
         catch (Exception exception)
         {
            PCSException.LogException(Get.File(), Get.Line(), exception, MessageSeverity.Severe);
            MessageBox.Show(
               string.Format(BauerControls.NVH.NVHVisualizationControls.Properties.Resources.UnknownErrorWithLocation,
                  GetLocation(),
                  Environment.NewLine,
                  exception.Message),
               BauerControls.NVH.NVHVisualizationControls.Properties.Resources.UnknownErrorCaption,
               MessageBoxButtons.OK,
               MessageBoxIcon.Error);
         }
      }

ArctionTero
Posts: 42
Joined: Thu Mar 28, 2013 9:20 am

Re: ViewXY: Panning when fully zoomed out

Post by ArctionTero » Thu Jul 24, 2014 5:16 am

Latest (6.0.9) should contain cancel in BeforePanning as it hasn't been removed since introduced.

Are you absolutely sure you have referenced correct dll?
LightningChart Support Team, TK

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

Re: ViewXY: Panning when fully zoomed out

Post by greggorob64 » Mon Jul 28, 2014 3:55 pm

I'm totally wrong. When I downloaded source I (stupidly) opened the source sent to me in june, not the one from a week ago.

Oops! You can kill this thread.