ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Display real time data on Intensity Graph

Solved!
Go to solution

I am using measurement studio 2015 WPF version. My requirement is to display real time data on a intensity graph . I used uint[,] to store the data and set datasource through binding. When I refresh the data , chart is flickering always .

1. How to avoid flickering effect while updating new data ?

2. what is the best way to display live data on a IntensityGraph ?

 

Thanks,

Rajeesh P

 

0 Kudos
Message 1 of 2
(2,580 Views)
Solution
Accepted by topic author rajeeshp

Could you provide a sample application that reproduces the issue? I was not able to reproduce the issue using the code below, and a simple DataSource="{Binding}" on the graph in XAML. I also tried using a single array and calling Refresh, but did not see any flickering.

public partial class MainWindow : Window {

    private readonly Random _random;
    private readonly DispatcherTimer _timer;

    public MainWindow( ) {
        InitializeComponent( );

        _random = new Random( );
        _timer = new DispatcherTimer( TimeSpan.FromSeconds( 0.1 ), DispatcherPriority.Normal, OnTimerTick, Dispatcher );
    }

    private void OnTimerTick( object sender, EventArgs e ) {
        const int Rows = 101;
        const int Columns = 101;

        var data = new uint[Rows, Columns];
        for( int i = 0; i < Rows; ++i )
            for( int j = 0; j < Rows; ++j )
                data[i, j] = (uint)_random.Next( 0, 101 );

        _graph.DataContext = data;
    }

}
~ Paul H
0 Kudos
Message 2 of 2
(2,559 Views)