How can I generate a real-time highchart from my database data?

I have looked several links; however, I couldn't find a working demo showing how to implement a highchart using data from a database.
Objective: I want to generate a real time highchart line graph getting data from my database. What I want is very similar to the
HighChart Demo which provides a real-time highchart with randomly generated values. It is also similar by X-axis and Y-axis, for I want my x-axis to be "Time" (I have a DateTime column in my database) and y-axis to be an integer (I have
a variable for that as well in my database).
Please I need help in sending the model data to my razor view.
Note that I am already using SignalR to display a realtime table. I also want to know if it can be used to automatically update the highchart as well.
Below is the code snippet of my script in the view. I have used the code provided in
HighChart Demo link for generating the highchart. Please tell me where should I apply the changes on my code.
@section Scripts{
<script src="~/Scripts/jquery.signalR-2.2.0.js"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="~/SignalR/Hubs"></script>
<script type="text/javascript">
$(document).ready(function () {
// Declare a proxy to reference the hub.
var notifications = $.connection.dataHub;
//debugger;
// Create a function that the hub can call to broadcast messages.
notifications.client.updateMessages = function () {
getAllMessages()
// Start the connection.
$.connection.hub.start().done(function () {
alert("connection started")
getAllMessages();
}).fail(function (e) {
alert(e);
//Highchart
Highcharts.setOptions({
global: {
useUTC: false
//Fill chart
$('#container').highcharts({
chart: {
type: 'spline',
animation: Highcharts.svg, // don't animate in old IE
marginRight: 10,
events: {
load: function () {
// set up the updating of the chart each second
var series = this.series[0];
setInterval(function () {
var x = (new Date()).getTime(), // current time
y = Math.random();
series.addPoint([x, y], true, true);
}, 1000);//300000
title: {
text: 'Live random data'
xAxis: {
type: 'datetime',
tickPixelInterval: 150
yAxis: {
title: {
text: 'Value'
plotLines: [{
value: 0,
width: 1,
color: '#808080'
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' +
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
Highcharts.numberFormat(this.y, 2);
legend: {
enabled: false
exporting: {
enabled: false
series: [{
name: 'Random data',
data: (function () {
// generate an array of random data
var data = [],
time = (new Date()).getTime(),
i;
for (i = -19; i <= 0; i += 1) {
data.push({
x: time + i * 1000,
y: Math.random()
return data;
function getAllMessages() {
var tbl = $('#messagesTable');
var data = @Html.Raw(JsonConvert.SerializeObject(this.Model))
$.ajax({
url: '/nurse/GetMessages',
data: {
id: data.id,
contentType: 'application/html ; charset:utf-8',
type: 'GET',
dataType: 'html'
}).success(function (result) {
tbl.empty().append(result);
$("#g_table").dataTable();
}).error(function (e) {
alert(e);
</script>

Hi Sihem,
Thank you for contacting National Instruments.  Using the LabVIEW Real-Time module, you can do development without actually having a target.  While viewing the project explorer window, you can do the following steps:
Right click on the project
Select New >> Targets and Devices
Select the "New Target or Device" radio button
Select the target you would like to develop on.Information about the LabVIEW Real-Time Module can be found here.
Regards,
Kevin H
National Instruments
WSN/Wireless DAQ Product Support Engineer

Similar Messages

  • How can I implement a real time datawarehouse

    Hi, I'm a little lost here but I want to know how can I implement a real time datawarehouse in sql server, I don't know if it is only to make the extraction process the shortest time possible.
    Thank you

    Hi Mega15, 
    I agree with everything Seif and Louw said, but I'd like to add that if you are using SQL Server 2012 or 2014 and you want to use DirectQuery or ROLAP mode (depending on what SSAS mode are you using, tabular or multidimensional) you may be interested on
    using columnar indexes on your base tables. 
    Analytical and aggregated queries will take GREAT advantage from these indexes, they will perform much better than with traditional B-Tree indexes in most of your scenarios. 
    Regards. 
    Pau.

  • HT204380 How can I make a face time call from one country to another( supporsing both parties using iphone 4s). What will be the caller charges. If there is no charges as we use wifi, will there be a charge till connecting the call?

    How can I make a Face Time call from one country to another( supporsing both parties using iphone 4s). What will be the caller charges. If there is no charges as we use wifi, will there be a charge till connecting the call?

    FaceTime is free to use. You will not be charged for using FaceTime.

  • How can I generate a table of contents from bookmarks

    How can I generate a Table of Contents from bookmarks in Adobe Acrobat XI?

    Something to try.
    Rick Bostein  provided a "Create Bookmark Report" Acrobat Action.
    With this report as a PDF you could insert it at the start of your PDF document to serve as a "TOC". 
    Go here:
    https://acrobatusers.com/actions-exchange 
    Scroll down some.
    Be well...

  • How can 2 users collaborate real time on a Pages document?

    I have two computers at home: an iMac and a macbook pro. We have no problem sharing document via the wireless Timecapsule network. Recently, as we have been deep in editing documents using Pages, we were trying to find out how to configure pages so that we can both edit the same document at the same time (collaboratively) and see each other's edits in real time as we progress. Google docs has this option but it's rather slow.
    Is there an option to do this in Pages on a local network?
    If no, do you know of any other Apple programs that let you collaborate on text document in real time?
    Thank you.

    Welcome to the forums!
    Pages cannot do what you want. Most word processors can't. However, there are a few solution that can. SubEthaEdit is a collaborative text editor for the Mac, so it can handle this kind of task. It has received pretty positive reviews. You might also check out Collaborate, UNA (although this is more intended for software development), and Gobby.

  • How can I set a Real time execution for applicatio​n on windows 2000

    I'm searching for a vi or a DLL that make me able to set an application thats run on windows2000 to a real time execution.
    I can do it manualy by the task manager, but how to do it automaticaly by Labview?
    Thanks
    Benoit Séguin
    Software Designer

    > I'm searching for a vi or a DLL that make me able to set an
    > application thats run on windows2000 to a real time execution.
    > I can do it manualy by the task manager, but how to do it automaticaly
    > by Labview?
    >
    Assuming all of the VIs are currently set to Same As Caller execution
    system, you can affect all of the VIs below by setting a particular VI
    to a higher priority.
    Be careful that your VI is calling wait ms or releasing time to the OS,
    or the time critical setting will cause the OS to ignore many of its
    normal tasks.
    Greg McKaskle

  • How can I Know the real time of my 24p project?

    I made an animatc as part of planning a 7 min animated video on Premiere Pro using a 24p project, trunsting that my ruler is set to 24 fps and that the time displayed was the real time of the video (not the NDF time), since there was no indication on Premiere's create sequence window that the ruler was on NDF basis. (When you cerate a new sequence,on the new sequence settings window you set the timebase as 23,976, but the ruler is shown as 24FPS, no indication of drop or non drop frame.)
    Recently I Had to export a 29,97 version of my project, and it was in fact 14 frames bigger. So I concluded that my time ruler was also showing me a NDF time not the real time of the video.
    Is there a way of creating a 24p project, with a ruler that gives me the real "clock" time? Or any Formula to "convert" a NDF time to DF (real) time, so I know where, on an NDF ruler, do I have  to stop to have a 7 min video?
    Thanks in advance
    Mauricio

    I think the best you can do is use the System Information application (Utilities Folder), looking in the wireless section.
    charlie

  • How can I generate a single timer event in a loop?

    I have a simple PID script running inside of a timed loop to control a heating process.  It works perfectly except that I cannot find a clean way to start the timer when it reaches the setpoint.
    Right now, the loop just runs for a set amount of time (e.g., thirty minutes).  I want it to run for a set amount of time after the heating reaches the setpoint.  I can think of several ways to fudge this, for example with a couple of shift registers and a case structure or with a second loop, but these options seem very clunky.
    I am sure there is a better way.  Can I somehow create an event within the loop that only happens once, for example, to give a timer value one time when a boolean value changes and never rewrite it?
    Thanks in advance for your help.

    You could keep the boolean value in a shift register or a feedback node.  You then need a little bit of logic to check to see if the boolean changed from false to true.  From there, you can put in your get timer inside of a case structure.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can I delete a "Run Time Air" from my mac book pro

    how can I get rid of the "Run Time Air" on my Macbook Pro

    Welcome to the Apple Support Communities
    If you use Snow Leopard, open iTunes, go to iTunes Store in the iTunes sidebar and log out

  • How can I uninstall Labview run time engine from the machine?

    I understand that Labview has not given any provision to show customized 'License Agreement screen'. Isn't it? This is the main cause of my problem. Since I want to show our own license agreement (LA) screen, I made the one using Labview. To show this license agreement screen, I first install a small application which has only this LA screen with Labview run time engine. The customer can see License Agreement Screen with Labview Run Time Engine on his machine. If My customer accepts the LA, I will install the main application further by calling another setup.EXE file.
    If my customer selects 'Do Not Agree' to the LA, I will quit the installation process. Here I also want to 'uninstall' Labview Run Time Engine
    from his machine since he doesn't accept License. I would like to know how to uninstall Labview run time engine from his machine?
    Another way which I could think is to run the LA screen from the CD with Labview run time engine on the CD. I will start installing the main S/W to the customer's machine with LABview Run Time Engine only after he accepts License agreement. I would like to know how to run the Labview application from CD without installing run time engine on the target machine?
    Can anyone suggest solution to my problem?
    Thanks,
    Chander

    J-Tek,
    I would suggest re-installing the Run-time Engine and then uninstalling it after a reboot. Also, you can download a program called Msicuu.exe (for NT, 2000, XP or Msicu.exe for 9x) to help clean up the registry for uninstalled programs.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • How can i backup iphoto in time machine from external drive

    I have recently placed iphoto onto an external drive to save on space.  How can I still ensure that this is backed up on time machine?
    Thanks

    If you're on 10.5 best to take that to a Time Machine forum here
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.5_leopard

  • Noob question - How can I copy a specific time sequence from an audio file

    Hello, I want to chop up an audio file
    into time-specific lengths.  How can I accomplish this precisely?  I know I can position the playhead precisely but
    how can I copy a chunk of an audio file, for example, if I wanted the segment from 00:02:34.7
    to 00:05:42.1?  Is my only option the "drag" selection of the
    Time Selection tool?  Is there not an option to do some start and end point setting so I can be as arbitrarily precise as necessary?
    Thanks in advance for any help.

    Copy from Messages.
    Paste into Notes.
    Copy the desired sentence from Notes.
    Paste as desired.

  • How can I capture in forms the text from a database error

    In forms6i, how can I capture the text of an error during the execution of a dabatase procedure or package.
    Thanks for your help.

    You can use SQLERRM function :
    SQL> create or replace procedure procerr
      2  is
      3     n number;
      4  begin
      5     n := 1/0;
      6* end;
    SQL> /
    Procedure created.
    SQL> set serveroutput on
    SQL> declare
      2     err1    varchar2(200);
      3  begin
      4     procerr;
      5  exception
      6     when others then
      7             err1 := SQLERRM;
      8             dbms_output.put_line(err1);
      9* end;
    SQL> /
    ORA-01476: divisor is equal to zero
    PL/SQL procedure successfully completed.
    SQL>

  • How can I access my Airport Time Capsule from a remote location?

    I have my 2 TB Airport Time Capsule connected to my home wireless network and I have heard it is possible to access my information stored on it from anywhere, but I have no clue how to do this.

    Frankly, this is not easy, and not for the faint of heart.  Having someone to help who has done this will save you a ton of time and headaches.
    Set up and use Back to My Mac - Apple Support
    Before you do anything though, Back to My Mac assumes that you have a simple modem......not a modem/router that is often provided by Internet Service Providers to their customers.  A modem/router.....also called a gateway.....will not allow Back to My Mac to work correctly, so if you do have a modem/router or gateway device, you will need to speak to your service provider to find out if they can provide you with a simple modem.
    A simple modem will look something like this:
    A modem/router or gateway will look something like this:
    Having said this, personally I use another method called Port Mapping to allow my Mac...or an iPhone or iPad connect back to the Time Capsule at home when I am traveling.  But, this is even more complicated than Back to My Mac, so BTMM would be the place to start for most users.
    If things look intimidating on first pass and you can locate a good tech to set things up for you, that would be money well spent.

  • How can I access to my time capsule from internet?

    The main reason for bought a time capsule was that i thought i could access to my documents in it from internet. Now I can't find information about it in internet. It is possible to do it?...
    Thanks!

    Since Apple has changed the MobileMe service it is difficult.
    If you have a static IP yes, easy.. in your Mac (must be a Mac), in finder go, go to server, type AFP://IPofTC
    That is the public IP of the TC assuming it is the only router in the network, and you have checked wan access in the disk settings.. and put in a decent password.
    If you do not have a static IP, the TC is difficult. There is no dyndns client.. and you have to have your own domain to get the IP of the TC as it rotates.
    It is easier as almost every router available today has dyndns client.. to relegate the TC to bridge and use a different router and simply port forward AFP.. Please search as there are plenty of posts about how to do it.
    Give exact details of your network if you run into issues.
    And think about security .. AFP is not highly secure.

Maybe you are looking for

  • I photo wont open

    when i try and open iphoto this comes up- Your iphoto library is either in use by another aplication or has become unreadable- Shut down and restart your computer, and then open iPhoto again. If the problem persists, try rebuilding your photo library

  • Queues for RFC-Destination

    Hallo, must i assign a rfc-destination to a outbound queue? what happens when this is not done? Thanks in advance, Frank

  • Can't Install PE 11 on iMac OS 10.2

    Installation won't go past 0% before getting an installation error message.  I have searched for solution to this problem, but can't find anything that solves the problem. Hours of time wasted! I have never had issues in past installing Adobe softwar

  • What is the error message "This item cannot be shared while it is still referencing media on the camera" mean?

    When I tried to create a movie, I got this message: "This item cannot be shared while it is still referencing media on the camera".  What does it mean?  How do I resolve it?

  • Macbook pro 2011 maximum plug in time

    I just got a new macbook pro 2011 and within a within a week I already have 9 charge cycles. The way I've been using it everyday, I'll charge it to 100% and then take it off, let it go down to 30-50%, and plug it back in till 100%. Using it like this