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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Trying to display label every second with DateTimeAxis

Thread ID:

Created:

Updated:

Platform:

Replies:

125736 Sep 8,2016 01:39 AM UTC Sep 9,2016 10:37 AM UTC WPF 4
loading
Tags: SfChart
Tyler Zale
Asked On September 8, 2016 01:39 AM UTC

Hi,

We are trying to display the tick labels every second for real-time audio data (using FastStepLineBitmapSeries). We also want the chart to auto scroll with the data on a 0.5 second window

If we use:           
DateTimeAxis
Interval = 1;
IntervalType = DateTimeIntervalType.Seconds;

then the app will lock up and crash (the above will work properly if we use something like a 1 minute interval - but still not with scrolling - see below):

ContextSwitchDeadlock occurred
Message: Managed Debugging Assistant 'ContextSwitchDeadlock' has detected a problem in 'C:\Users\Tyler\Documents\Visual Studio 2015\Projects\Collage-Xamarin\Collage.WPF\bin\Debug\MedwebLIVE.exe'.
Additional information: The CLR has been unable to transition from COM context 0xcb53e0 to COM context 0xcb5328 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.



When we switched to our custom Axis class to do the scrolling it no longer crashes but ignores the intervals for the grid:

using Syncfusion.UI.Xaml.Charts;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Collage.WPF.Components
{
    public class RealTimeAxis : DateTimeAxis
    {
        private const double DISPLAY_X_AXIS_SECONDS = 0.5d;
       
        public RealTimeAxis() : base()
        {
            ActualRangeChanged += RealTimeAxis_ActualRangeChanged;
            Interval = 1;
            IntervalType = DateTimeIntervalType.Seconds;
        }

        private void RealTimeAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
        {
            if (e.IsScrolling)
                return;

            DateTime? date = e.ActualMaximum as DateTime?;
            if (date.HasValue)
            {
                e.VisibleMinimum = date.Value.Subtract(TimeSpan.FromSeconds(DISPLAY_X_AXIS_SECONDS));
            }
        }
    }
}


Devi Aruna Maharasi Murugan [Syncfusion]
Replied On September 8, 2016 10:17 AM UTC

Hi Tyler, 
  
Thanks for contacting Syncfusion Support. 
  
We have analyzed the reported problem and unable to reproduce the problem at our end. We have prepared a demo sample based on provided requirement and it can be downloaded from below link, 
  
  
If you are still able to reproduce the issue, please revert us by modifying the sample. It would be helpful for us to serve you better. 
  
Regards, 
Devi 




Tyler Zale
Replied On September 8, 2016 04:57 PM UTC

Hi,

Your example shows exactly the problem we are trying to fix.


It repeats the labels instead of only showing one label on the first entry of every second. Is there a way to fix this?



Example we want to display:


blank blank blank 12:00:01 blank

insead of:

12:00:01 12:00:01 12:00:01 12:00:01 12:00:01




Tyler Zale
Replied On September 8, 2016 09:42 PM UTC

solved by using EnableAutoIntervalOnZooming = false;

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On September 9, 2016 10:37 AM UTC

Hi Tyler, 
  
Thanks for your update. 
  
Please contact us, if you need any further assistance, 
  
Regards, 
Devi 


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.

Warning Icon 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.Close Icon

;