JQuery flot, Live plotting from SQL Server

I have an MS SQL Server that constantly transfers data. I want to make an ASP.NET Webapp or web page that can build data and update it in real time.

Through research, I discovered that jQuery and Flot are good options. Can someone please direct me in the direction regarding how I will deal with this? Im very new to web development. I am new to ASP.NET. I do not know anything about JavaScript / jQuery / flot and could not find good guides in this particular direction.

Things I've tried so far: WPF-> Limited functionality, when it comes to interactivity, JavaScript feels much more open to functionality. Microsoft ASP.NET Chart Controls -> Same as above.

Thanks for the help!

+4
source share
2 answers

For example, if you want your schedule to be updated every 0.2 seconds. You can do the following:

var plot = $.plot($("#placeholder"), {},{} ); var timer = setInterval(function(){ $.ajax({url: 'url to fetch data', dataType: 'json', success: function(data){ plot.setData(data); plot.setupGrid(); plot.draw(); }}); },200); 
+2
source

@ VinhBS approach is ajax polling method. If you want to update "in real time" when the data arrives at the server, you want to implement the so-called comet . I would read the options and decide which one is best for your application (I personally like the "long XMLHttpRequest poll" approach).

Please note that for the fleet you will need to redraw the entire chart each time new data is received. If you are looking for something that will “show” new user data, I would look at the possibilities of dynamically updating HighCharts.

0
source

Source: https://habr.com/ru/post/1392179/


All Articles