06-05-2019 04:10 AM
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
Solved! Go to Solution.
06-05-2019 10:17 AM
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;
}
}