G Web Development Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp value on hover

Solved!
Go to solution

Hi, 
I'm building a graph which consists in having amplitude in Y while Timestamp on X
I'm using a cluster which reciever data from 2 arrays(amplitude  history and timestamp history)
However, when hovering in the graph, the timestamp value converts to a non timestamp value as you can see in the image below.
I wonder if i can see the timestamp hovering the data point..Therefore, i know the exact time the value was aquired.

Labmecepel_1-1708694889396.png

 

Labmecepel_4-1708695504890.png

 

 

 

 

 

0 Kudos
Message 1 of 5
(697 Views)

Hi, i found the library PlotHoverTooltip, and i'm trying to use it, however i've come across an error.

Since my code is a little different, and the graph is displayed by a cluster i dont know if it impacts on the error.

 

The example attached with the library worked fine, but when i use it in my project i get the follow error:

Labmecepel_0-1709039581809.png

Labmecepel_2-1709039713240.png

 

 

JavaScriptInvoke in Library::Support::PlotHoverFormat.jsli::Plot Hover Format X AbsTime->Library::XAbsTime GraphTooltip.gvi->WebApp::Páginas::Function.gviweb<APPEND>
An exception occurred within the external JavaScript function called by a JavaScript Library Interface node. Verify your JavaScript code is valid.
function: PlotHoverFormat.XAbsTime, Additional information:
Message: Cannot read property 'querySelector' of undefined
Stack: TypeError: Cannot read property 'querySelector' of undefined
at Object.XAbsTime (http://localhost:54907/HtmlVI/Run/VireoDevSystem/Interactive/Library/Support/script.js:9:74)
at e.javaScriptInvoke.jsJavaScriptInvoke (http://localhost:54907/HtmlVI/Run/VireoDevSystem/Interactive/WebApp/ni-webvi-resource-v0/VireoImport...)
at u (http://localhost:54907/HtmlVI/Run/VireoDevSystem/Interactive/WebApp/ni-webvi-resource-v0/VireoImport...)
at wasm-function[1302]:175
at wasm-function[982]:124
at Object.D.e.eggShell.executeSlicesUntilWait.t.eggShell.executeSlicesUntilWait (http://localhost:54907/HtmlVI/Run/VireoDevSystem/Interactive/WebApp/ni-webvi-resource-v0/VireoImport...)
at zo.executeVireoRuntime (http://localhost:54907/HtmlVI/Run/VireoDevSystem/Interactive/WebApp/ni-webvi-resource-v0/IdeRun.min....)
at e.vireo.eggShell.setExecuteSlicesWakeUpCallback (http://localhost:54907/HtmlVI/Run/VireoDevSystem/Interactive/WebApp/ni-webvi-resource-v0/IdeRun.min....)
at http://localhost:54907/HtmlVI/Run/VireoDevSystem/Interactive/WebApp/ni-webvi-resource-v0/VireoImport...

0 Kudos
Message 2 of 5
(636 Views)
Solution
Accepted by topic author Labmecepel

@Labmecepel wrote:

The example attached with the library worked fine, but when i use it in my project i get the follow error:

 

function: PlotHoverFormat.XAbsTime, Additional information:
Message: Cannot read property 'querySelector' of undefined
Stack: TypeError: Cannot read property 'querySelector' of undefined


Have you define your Graph Control HTML Class Attribute?

And you need to make sure that your Graph has a plot on it. that for, wire the error cluster.

 

Screenshot 2024-02-27 204238.pngScreenshot 2024-02-27 204340.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And you don't need to double write to your graph value.

Labmecepel_2-1709039713240.png

 

 

Message 3 of 5
(630 Views)

It worked, thank you!

0 Kudos
Message 4 of 5
(613 Views)

@Labmecepel wrote:

It worked, thank you!


Glad to hear that. You're always welcome🙏

 

Just to let others whom looking for the example source:  Solved: Graph Hover Format for Time Axis. - NI Community  

 

 

0 Kudos
Message 5 of 5
(476 Views)