How do I plot XY-Graph if case is true?
It seems to me that it always has to be a while-/for loop before XY-Graph, I need a Case window instead, is that possible? If, how do i make it work?
The XY graph takes an array of bundled XY values (or vice versa) as input, it does not care how that array has been created or whether it is in this structure or that. I think there must be some basic consept that you are missing, but upload a copy of your VI or a picture of the code and explain what you are trying to achieve, and we'll probably find a solution.
MTO
Similar Messages
-
How do I plot bar graph using MStudio.NE​T for VB
I can not find the FillToBase property in waveformplot object using MStudio 7.0 for VB.NET. How can I plot the bar graph like that in Mstudio 6.0.
The Measurement Studio .NET WaveformPlot does not currently have an equivalent for CWPlot's FillToBase property. In the meantime, though, you can use the WaveformPlot's custom drawing services to emulate this functionality. For example, if you dropped a new WaveformGraph on a form, you could copy and paste the following code to draw bar graphs on the WaveformPlot:
Private Sub OnBeforeDrawPlot(ByVal sender As Object, ByVal e As BeforeDrawXYPlotEventArgs) Handles WaveformPlot1.BeforeDraw
DrawBarGraph(e, 0, Color.BurlyWood, Color.Firebrick)
End Sub
Shared Sub DrawBarGraph(ByVal e As BeforeDrawXYPlotEventArgs, ByVal baseYValue As Double, ByVal outlineColor As Color, ByVal fillColor As Color)
Dim plot As XYPlot = e.Plot
Dim g As Graphics = e.Graphics
If plot.HistoryCount > 0 Then
' Clip the data to just what will be drawn with the current axis ranges.
Dim xData() As Double, yData() As Double
plot.ClipData(xData, yData)
' Calculate the screen coordinates of a base y value and the clipped data.
Dim baseY As Double = CType(plot.MapPoint(e.Bounds, 0, baseYValue).Y, Double)
Dim points As PointF() = plot.MapData(e.Bounds, xData, yData, False)
Dim outlinePen As Pen = Nothing
Dim fillBrush As Brush = Nothing
Try
outlinePen = New Pen(outlineColor)
fillBrush = New SolidBrush(fillColor)
' Iterate through the mapped points and calculate the bar, fill it, and outline it
For i As Integer = 0 To points.Length - 2
Dim currentPoint As PointF = points(i)
Dim nextPoint As PointF = points(i + 1)
Dim barX As Single = currentPoint.X
Dim barY As Single = currentPoint.Y
Dim barWidth As Single = nextPoint.X - currentPoint.X
Dim barHeight As Single = baseY - currentPoint.Y
g.FillRectangle(fillBrush, barX, barY, barWidth, barHeight)
g.DrawRectangle(outlinePen, barX, barY, barWidth, barHeight)
Next
Finally
If Not outlinePen Is Nothing Then
outlinePen.Dispose()
outlinePen = Nothing
End If
If Not fillBrush Is Nothing Then
fillBrush.Dispose()
fillBrush = Nothing
End If
End Try
' Cancel any further drawing since we completely handled the drawing of the plot.
e.Cancel = True
End If
End Sub
Hope this helps.
- Elton -
How can I plot a graph in sections???
Hi
This is what I am trying to do:
I have a graph class that uses a double array to plot.. surprisingly a graph. The problem is that the file that I am plotting from is too large to display all of its data at once on the screen.
What I am trying to do is have a forward and back button that will allow you to display a fixed chunk of data at a time.
Also does anybody know how to clone a double array????
Any help would be great...
Cheers...........Read the file.
Write a funtion to return all values from
starting from start to end like
public double[] getData(int start, int end)
Use the charting tool to plot only the current set of
values.. Change the start and end parameters according to
what the user wants.. (forward or backward)
Try JFreechart... Its an excellent charting tool.. -
Plot xy graph using random number generator
How do i plot xy graph dynamically every 5 seconds with a random number generator?
X axis : Time
Y Axis : Random number generatorI've done tis so far. im able to plot dynamically every 1 second.
but the problem i am facing is The X axis display every 1 second.
i want it to be fixed 24 hours time format, and the data will gradually plots the data on y axis against x axis every one second, without changing the scale of the x axis (24hour time format) -
How to plot waterfall graph in vb6 from offline data
How to plot waterfall graph in vb6 from offline data?The data load from SQL Server Database.Thanks.
asrol,
If you look at the Plot Styles example in the folder I mentioned in the previous post there is a section of code there that you might want to refer to in order to recreate your data.
'=============================================================================
' Plot Curve Button Handler
'=============================================================================
Private Sub PlotCurve_Click()
' Create curve data
Dim x(40)
Dim y(40)
Dim z(40)
For i = 0 To 40
x(i) = Sin(i / 3#)
y(i) = Cos(i / 3#)
z(i) = i
Next i
In this example they create 3 arrays to represent the three dimensions of the array. For your case if you were to plug your data into two of the array (axes) that would give you the data for the channels, then you can simply input a constant for the third array it would produce a single line of your data as shown in your example GIF. You can then repeat this process for each set of data, with a new constant value for that third axis, and it should manually create a graph that will look something like you desire.
John B.
Applications Engineer
National Instruments -
How do I plot multiple points (scatter) on the same graph?
Hello,
I have a graph with a fixed X-axis and an array of Y values which varies. How do I plot these new y values without replacing the previous ones? E.g to have a scatter of new data? Example of shown in Figure 1 below:
Figure 1: (Note: image was photoshopped to demonstrate goal)
Figure 2: Current block diagram, LabVIEW VI:
Thank you!
Solved!
Go to Solution.Think about what you are really building. You are building an array of clusters, right? For each element in the array you have a cluster whos content has a value for the X axis and a value for the Y axis. As long as you are not connecting the datapoints in the graph (which you aren't), you can plot the datapoints in any order. If you are building your X portion of the cluster seperately than your Y portion of the cluster, you just have to make sure the indexes do not get transposed somehow.
Build the lower half of the attached picture, and you will see what I mean. (hopefully)
Attachments:
Chart.PNG 21 KB -
How do I add a vertical cursor to a 2-plot xy graph?
I have a 2-plot xy graph, and I would like to add a vertical cursor that can be dragged to any x position, and have the 2 y values displayed. How do I do this?
OK, my problem is deeper than reading cursor position. My cursor disappears when the VI is first run, never to appear again. I have the X-axis set up for absolute time, and I think that might have something to do with it.
Attachments:
CC View Data Graph.zip 26 KB -
How do I get the numbers ipad app to plot a graph of dates against values, where the most recent date is on the right of the graph, but the most recent date is at the top rather than bottom of the rows in the table?
Also how can it be a line graph without plotting a circle at each value?
Thanks this is very frustratingMake a copy of the table and produce your Line chart or Bar chart from the copy. Sort the copy into the order you want to see in your chart.
Alternately you could use a Scatter Chart...
Jerry -
How to connect mysql database to labview and plot the graph
Hi all,
I am doing my final year project about labview. I need to connect my mysql workbench database to labview and plotting two sinwave in same graph. I can already connected my labview to mysql and showing the data in labview table.But I need to plot the two sinwave in on graph according to table data. Eg: table data: timestamp wind speed wind direction
2004-01-01 0.5 56
2004-01-01 0.6 60
The attachemtn vi is about inserting file and plot the graph. And now I want plotting the sinwave using table data and the wind speed Y-axis,wind direction Y-axis in both side of my graph and the X-axis is showing the whole day timing like 00:00:00-24:00:00. Can anybody combine these 2 vi to polting the graph according table data not according to file data.Thanks
Attachments:
Mysql.vi 11 KB
Insert File.vi 25 KB
Wind Project.vi 24 KBPlease don't start a new thread. Stick to the original.
http://forums.ni.com/t5/LabVIEW/How-to-plot-waveform-or-graph-using-table-database-which/td-p/294036... -
How to plot a graph in JSP
Hi!
You can use jfreechart.
It is a good tool and if you search on Google you can find more info and more web examples (files, .war, ...)
Bye. -
How to plot XY graph from 2 input of dynamic array ? ...
I have 2 problem when I plot XY graph with 2 dynamic array :
- I want to make the graph look like sweep chart. But it's seem not possible to use waveform graph?
- The graph shoul move from left to right , then right to left, then left to right,.....
Any one can give me some hints? Thanks alot.
Attachments:
U1.PNG 21 KB
XY radom value input.vi 147 KBI have to make Y change from 0-10, then 10-0,.... Any one can help me to make it better?
- How I shift the graph?
Attachments:
working_increse_decrease.vi 20 KB -
How can I get my graph to plot vs. my data points instead of vs. time?
how can I get my graph to plot vs. my data points instead of vs. time?
Maybe you could exaplin in a few more words what "my data" is. Are the values equally or randomly spaced?
If they are equally spaced, just adjust offset and multiplier, and axis label.
If they are randomly spaced you are probably looking for an X-Y graph. Check the shipping examples.
LabVIEW Champion . Do more with less code and in less time . -
Thanks John for your answer. Attached file the sample graph what i really want to plot it.Any body can help me.Thanks.
Attachments:
waterfall.gif 81 KBHello asrol,
Please try to post replies under the same thread so that it is easier for everyone to keep track of your issue. Thanks!
Original thread: How to plot waterfall graph in vb6 from offline data
John B.
Applications Engineer
National Instruments -
How to Send Multiple Plot XY Graph from LabVIEW to Microsoft Excel
The link below describes exactly what I would like to do, however the link to the solution/work around does not work.
Has anyone got an alternative solution?
http://digital.ni.com/public.nsf/allkb/CFD30D5E9C01AB5386256CFB0082AF3EPlease check the link again as it seems to be working fine now.
How to Send Multiple Plot XY Graphs from LabVIEW to Microsoft Excel:
http://digital.ni.com/public.nsf/allkb/CFD30D5E9C01AB5386256CFB0082AF3E
The standard Excel Insert Graph.vi cannot insert multiple XY Graphs to Microsoft Excel, so you will need to use the Report Generation Toolkit for Microsoft Office. You will find a link to an example program at the bottom of the page. I have also attached it below.
Attachments:
example.zip 35 KB -
How can I save the plot on Graph control to disk like the plot on Picture.vi ?
Dear all
I have a question about saving the plot on graph control.
In Labview,there is two way to make a plot, using graph control (eg. waveform control ,wavechart control) and Picture.vi (eg. plot XY vi and plot waveform VI ) ,
but for Picture.VI there is some control for saving them to disk (eg. write jpeg file.vi or write bmp file.vi )
My question is that may I save the plot display in graph control to disk using some vi like saving Picture to disk.
I only know we only can right clicking and export implified image to save the plot on graphic plot?
What want is save the plot on graphic control without interface and save to disk directly?
many thanks!RIght-click on your graph and select:
Create...Invoke Node and select method "export image". Wire the desired inputs and place it inside a case structure to be activated by e.g. a button.
LabVIEW Champion . Do more with less code and in less time .
Maybe you are looking for
-
EA Version 4.0 - Partition high-values are not displayed (NULL)
The partition high values are not schon in the "partitions" tab of the table. Only NULL was displayed.
-
How to use the Observer when a page loads
Anybody know how to use the Spry.Utils.addClassName('DivName','selected') and then fire the Spry.Utils.addClassName with onLoad? I am loading a page with the selector utils in it into a div and then I think I must need an Observer to get the Spry.Uti
-
I want to debug a bsp application (Z app), i am logged in remote desktop, ecc 6.0, internet explorer: 7 i have tried to test page directly from se80 and also from URL. I have tried setting external break-point, activating debugging for user..........
-
My computer turns off by itself quite a lot and sometimes my library has to be recovered if I was using Itunes when it happened. It usually all comes back but sometimes it resets the Date Added on all songs and it's so frustrating because that's one
-
Facing problem in placing and receiving calls in l...
Bought my lumia 720 a week ago. For past two days, i am facing problems during calls. Most of the my voice isn't audible to the receiver. It's happening during incoming calls and outgoing calls both. Its freakishly frustarting. Pls help me out. Note: