LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to mark time on x axis with irregular time values

Another approach is to hide the X-scale,
Plot values versus their index,
and put a cursor with its label visable at each data point.

This method is illustrated in the attached zip.

The code is sloppy, its just a demo.

Too many data points on the graph make this approach useless.

Add more cursors if you need them.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 21 of 32
(1,583 Views)
Hi Ben, thanks for the attachment, could you load it up again with LabView6.1 file?

tst, i do like what you have suggested (you may have missed a reply from me that is in the middle section of the messages), just i am probably a perfectionist, i want to be more flexible with a large data file such as 200 points, and user be able to adjust how many marks to show, and so on (I guess that maybe solvable by dynamically control the displayed array). I was having difficulty make the array boarders disappear with your approach. You mentioned classical array, how do I find this in the functions panel? I only see one type of array indicator. Thanks again.

Bryan.
0 Kudos
Message 22 of 32
(1,580 Views)
1. Ben - cool approach, albeit different. You've got my stars.
2. You can control how many elements of the array are shown and their width using property nodes. You can calculate how much you need using the plot area of the graph property and so on. I'm not sure they're all available on 6.1, but I think they are.
3. The classic controls can be found in the controls palette in the middle column, but I'm pretty sure they're not available in 6.1 since it doesn't have the 3D controls (if I remember correctly). You can make an array invisible by right clicking on its border with the color tool and selecting T (transparent) and by right clicking inside the cells and selecting T.

___________________
Try to take over the world!
Message 23 of 32
(1,571 Views)
Here is the demo as 6.1.

I do not think this approach will be good for 200 data points.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 24 of 32
(1,559 Views)
Thanks Ben, it is a beautiful graph! Now I just need to move the cursors onto the x axis (hope it is possible), and I just need to display fewer cursors, say every 5 or 10 points instead of at every point. (As I will have more data displaying in the grpah, the cursors need to go to where the x scale is. The sample data file does not represent my real data set.)

Best Regards,
Bryan
0 Kudos
Message 25 of 32
(1,555 Views)
I suggest using different cursor styles (just vertical line) and only show every 10th cursor (use quotient and reamiander function dividing the index by 10 (?) and check if equal to "0" to drive the visable property.

Set the Y value of the cursors to be soemthing low on the graph.

Please post what you come up with so other can benefit!

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 26 of 32
(1,550 Views)
Hi,

I have modified Ben's vi a little to get to closer to what i wanted. As you can see i still need to get rid of the x near the date label, and somehow the date labels are not even. Any more improvement on cosmetics and so on are appreciated.

Bryan.
Message 27 of 32
(1,518 Views)
Thanks for poting your new code.

Set cursor.pointStyle = 0 This will get rid of the "x"'s.

Use your positioning tool to position the text field relative to the cursor. They will keep their relative position. I did that in the original example I sent you.

Another idea I had was to use two X-scales and associate the plot with the index, just the way you have.

Then set the active X-scale to the second X-scale, make it visable, set the marker values for just the start and the end. This second scale should be formatted for date.

The next thing that could be added is to show the cursor legend and let the user scroll the postition of the cursors and update the cursor text as they go. That way they could scroll to an interesting event and see the date.

Just trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 28 of 32
(1,509 Views)
Here is your code with line styles set and the fudge factor removed that you put it to get things to line up.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 29 of 32
(1,506 Views)
Ben,

Thanks for the new code and the great ideas to make this approach not only really appealing but also very user friendly. Since this is an ongoing project, i will be gradually adapting your suggestions. Thanks again!

tst, I appreaciate your great suggestions and help too.

Best Regards,

Bryan.
0 Kudos
Message 30 of 32
(1,491 Views)