Plotting on 2y axis graph

I have a CWGraph with 2Y axis style. I would like to plot two individual plots, each one with its own y-axis. I have added a second plot from the properties window and I have assigned Y-axis2 to it. What instructions should I use to plot each set of points for each y-axis. I've tried:
m_graph.Plots.Item(1).ChartXY(time, voltage);
m_graph.Plots.Item(2).ChartXY(time, current);
but when I run the program, nothing appears on the plot window. Thanks in advance.

Looking at your project, there are two issues that I see. The first is this:
for(;
m_graph.Plots.Item(1).ChartXY(time, voltage);
m_graph.Plots.Item(2).ChartXY(time, current);
time++;
This is charting data in a very tight, endless loop. You'll notice that not only is the graph not updating, the entire application is not responding. This is because the application is not getting a chance to process windows messages, hence the UI does not get a chance to update. If you want to chart data continuously like this, you will need to either do it on a timer or pump messages somewhere in your loop so Windows messages can be processed.
We can temporarily work around this problem f
or demonstration purposes by changing the OnStart method like this:
void CTestDlg:nStart()
static double time = 0;
double voltage = 2.5;
double current = -10;
// for(;
m_graph.Plots.Item(1).ChartXY(time, voltage);
m_graph.Plots.Item(2).ChartXY(time, current);
time++;
The intent of this change is that we can click the Start button and data will be added every time that we click. Now if you run the application, you'll notice that there's only one plot displayed. This is because the Y axes are a fixed scale from 0 to 10, but your plot that's displaying current (the second plot) is charting data that's out of range. You can fix this by either adjusting the fixed range of the Y axis that's associated with the current plot, or you can configure it to auto scale.
Hope this helps.
- Elton

Similar Messages

  • How can I draw two differenct plots at the same graph?

    [I am beginner]
    I have two different set of data which have differenct x-axis values. How can I draw two data at the same plot?
    For example, one data set is
    x y
    1 3.5
    3 2.3
    5 1.3
    8 3.2
    The other
    1 2.3
    2.5 5.4
    4 2.5
    If I use m_graph.plotXvsY two times. But it draw only one graph at the same time.
    Please let me know. Thank you in advance.

    Do you really need the two sets of data on the same plot or is what you really care about is that the two sets of data are in the same graph? If it's the former, then there's not much that you can do since a plot can only contain one set of data. You can append to an existing set of data by calling the corresponding Chart (for example, ChartXvsY) method, but the result is that the plot's data will appear continuous.
    If it's the latter, the way to do this is to add multiple plots to the graph and plot each set of data in a separate plot. For example, go to the Plots tab in the graph's property pages, add another plot, then here's some sample code that demonstrates how to plot the sets of data from your example above:
    double xData1[] = { 1, 3, 5, 8 };
    double yData1[] = { 3.5, 2.3, 1.3, 3.2 };
    CNiReal64Vector xDataSet1(4, xData1), yDataSet1(4, yData1);
    m_graph.Plots.Item(1).PlotXvsY(xDataSet1, yDataSet1);
    double xData2[] = { 1, 2.5, 4 };
    double yData2[] = { 2.3, 5.4, 2.5 };
    CNiReal64Vector xDataSet2(3, xData2), yDataSet2(3, yData2);
    m_graph.Plots.Item(2).PlotXvsY(xDataSet2, yDataSet2);
    Hope this helps.
    - Elton

  • How to Generate Event on change in Plot Legend for XY Graph

    Hi,
    I have two XY graphs on the front panel and would like to maintain a common plot legend such that any change in the plot legend affects both graphs.
    Objective: I would like any value change in plot legend to fire an event.
    How do I program that?
    I know of value change event for the graph but am unable to find something specific to the plot legend. Other option is to have the user press a "refresh" button that will fire the event.
    Feel free to share thoughts on other elegant methods to achieve the same objective.
    Thanks,
    Gurdas
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu

    Hi Sarah,
    Looks like you are talking of exactly what I want!
    I have attached a sample VI to try achieve what I want. But it still has some issues which are:
    1) I am unable to configure a Plot Attribute Change Event. I have used a mouse leave event instead. How does one configure a Plot Attribute Change Event?
    2) Is there no single property which will transfer all the settings of plot legend from one graph to plot legend of another graph? In my sample VI, I have to read each property of the master graph and feed it into the slave graph.
    Kindly note I am using LV FDS 7.1 on Win2000
    Thanks,
    Gurdas
    Message Edited by Gurdas on 03-27-2006 11:51 PM
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu
    Attachments:
    Graph_PlotLegend_Event.vi ‏45 KB

  • Multi plot cursor in Mixed Graph

    If Digital waveform and normal waveform graph is plotted in a mixed graph, and if I choose watch all plots(multi plot) in cursor, LabVIEW closes immediately with an error popup dialog
    I have attached the print screen image of that error popup
    Attachments:
    error.JPG ‏188 KB

    Hi Stephen,
               I found a considerable solution to overcome that error.
               Build all the array data at first and then generate digtal
    waveform in single instance.
               ie., With number of numerical array data, build a 2D array of
    numerical data and make a transpose and then generate a waveform.
               It generates number of digital waveform equal to that of the
    column size of 2D Array.
               Do not build generated digital waveforms. This creates an error
    while using multi plot cursor--> watch--> All plots.
               I have attached the modified, bug removed Vi with this message for
    your reference.
    Regards,
    Raja
    Project Engineer
    Soliton Technologies
    www.solitontech.com
    Attachments:
    Mixed Graph Modified without Error.vi ‏25 KB

  • How do I determine the number of plots on a waveform graph?

    How do I determine the number of plots that have previously been plotted on a waveform graph? I am loading dynamic data from a file. If I convert to an array and size it and there is only one plot, I get the number of data points and I don't know how to tell the difference.

    Usually by reading the graph terminal or a local of it and determining the first or second dimension (not sure which at the moment) size of the resulting 2 dimensional array. If it is a 1 dimensional array you have either only one plot or an array of clusters each representing one plot. But as these data types are determined by compile time, there shouldn't be a problem with this causing ambiguity.
    Rolf K
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Xcelcius 2008 - Dual Axis Graph Mouse Over Display

    I am working on a dual-axis graph where one value is a percentage and another is numeric. I am having an issue where I cannot format the hovers into multiple formats (i.e. one as numeric, the other as a percentage). In the graph properties I only see one property to modify Mouse-Over Values, but I need to modify it for each axis.
    Thanks ahead of time.

    Hi Diney,
    I Have to show all the projects per client requirement, I want to remove the legends(which I already did), and instead show the project name only when the mouse is rolled over in the graph. Is it possible?
    Thanks for your time and help.

  • How can i make a plot in a 3d graph invisible

    hello all,
    attached is a half-way completed vi which shows how i would make the plot/plots in the 3d graph invisible. unfortunatly i do not know how "item" can refer to the plot i want to make invisible.
    any ideas?
    Solved!
    Go to Solution.
    Attachments:
    remove plot in 3d graph.vi ‏27 KB

    You are almost correct.
    The Item input is a string whose value is the name of the target plot. You can view all the plots names from shortcut menu->"CWGraph3D" group->"Properties" item->"Plots" tab ->"Plots" list.
    Attachments:
    remove plot in 3d graph.vi ‏20 KB

  • Anyway to implement a dual axis graph in xcelsius?

    anyone know how to implement a dual axis graph in xcelsius?
    i tried faking a dual axis graph by super imposing 2 graphs, one with the axis labels and the other one without, but the legends would never line up especially if i placed the legend at the bottom of the chart.
    any ideas?
    -shawn

    i am not able to get exactly the problem where  you are getting that, if you get it in line chart or any other charts we can fake any chart on the basis of scenario by giving display status key and another options also there for this.
    i hope you get some idea, if u not able to understand pls mail me with your exact scenarion i will send the complete solution to you.
    Thank you,
    Santhosh.

  • 2 axis graphs

    Is it possible to have a two axis graph with values of one axis in the form of a stacked graph and the value of the second axis displayed as a line graph?
    I can do it in a regular bar graph but I need a "stacked" bar

    ogsamerz wrote:
    i read this answer on another post. Im having a hard time figuring out how to reset the background.
    Also is it possible to set the second graph to a second y axis? to the right side of the graph?
    Select the front chart, then use the Fill: color well to choose None (the square with a slash through it at the top left of the color palette).
    Numbers places the Y axis and its value labels at the left of the chart. Use the Y axis options popup menu in the Axis section of the Chart Inspector to turn off Show Axis, Show Value Labels and Show minimum value. Add a text box and type in the values, including the minimum value, with enough returns after each to align the numbers with the grid lines. Add a Line using the Shapes button, rotate it 90 degrees. Use these as the Y axis (on the right) and Y value labels.
    Regards,
    Barry

  • How to Stack 16 Plots in an 8-Graph Chart

    Here's a good one:
    I have a stacked chart with 8 graphs. I'd like to display 16 plots on the 8 graphs with each 2 plots overlaid (in different colors). Is there a way to do that?
    Fataneh

    Hi Fataneh,
          Using the "transparent" color you could make one of two charts "see-through"...
     - what do you think?
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    overlay.GIF ‏61 KB

  • Is apple allow core plot framework to draw graph in iPhone app?

    is apple allow core plot framework to draw graph in iPhone app?

    Wrong forum. Ask in the developer's forum.

  • Hiding plots programatically in XY graphs

    My data acquisition plots five y values along a time axis. There are occasions when the number of plots is less than this due to user set-up of the test. The problem that I have is that the XY graph continues to plot all five values with the empty values drawn on the zero line of the y-axis. Whenever I try to disable the visible property of the plots it doesn't seem to recognise them as active plots and delivers an error code saying 'Invalid property...."etc. The plots can be made invisible only if the user choose to acquire 5 sets of data. Can you help?

    Make sure you are using the order: Set Active Plot -> Set Active Plot's Property
    As in the attached LV 6.1 example
    2006 Ultimate LabVIEW G-eek.
    Attachments:
    Vis_Graph.vi ‏45 KB

  • How to get bar plot stacked in one graph?

    Hi there,
    I am having a problem trying to get a stacked bar plot in one graph. I attached two images to show you what it looks like now and how I would like it to look.
    At the moment I am making two x,y clusters, bundle these into an array and give that as input to the XY graph. This gives me the image where the bar plots are shown next to each other. However, I want them to be shown on top of each other and I cannot find a way to do this.
    I searched this forum and the help and looked at the available properties for the XY graph, but it seems impossible. So I was wondering if anyone here is able to help me solve this.
    Thanks in advance,
    Steph.
    Attachments:
    current.png ‏7 KB
    wanted.png ‏10 KB

    Thanks! Maybe I am not understanding the terminology and a "stack graph" may not be what I am looking for, but here is my small example.
    DATE
    DATA 1
    DATA 2
    1/2008
    3
    4
    2/2008
    4
    8.5
    3/2008
    6.58
    38.9
    I would like to do a bar graph where DATA 1 AND DATA 2 overlap each other like Steph's example of a stack graph.
    and the "DATE" will be on 'x-axis'  while data 1 and data 2 will be values show on the y-axis. (Note: data 1 will always be data 2, it will show up with two colors where one color is always taller than the other).
    Is this stack graph the right path? I am new at using the graphing icons in Labview, I do not even know how to I would go about loading these as inputs to the VI.
    Please advise me on the right path. Thanks again!
    Eileen

  • How many curves can be plot on one 2D graph in DIAdem

    Hi everyone,
    I want to  plot some(360+) curves on one 2D graph.I have results for samples which are measured at different temperatures.I had no problems to plot the curves of all devices for one temperature.But what I noticed when I tried to plot curves of all devices for all temperatures is that it doesn't work.DIAdem (ver.10.2) gives an error if the number of curves is more than 250,how can this be?Is this a program limititaion which can be fixed with a patch or service pack, or I'm doing something wrong? 
    Thanks in advance
    Solved!
    Go to Solution.

    Hello fscommand,
    When you overlay the axis systems, make sure to turn of the colors for the axes, labels and ticks on the 2nd axis system. You can exactly align them in the "position" tab of the "Axis and curve definition" dialog.
    You only need to set this up once for every 250 overlayed curves, so it should be a relatively quick and painless effort.
    Let us know if you have any additional questions,
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Multiple Plots & Scales On 1 Graph

    Hi
    In one waveform graph how we can plot two data with different y-axis i.e.. Multiple plots in one graph
    thanks

    Hi Husssey,
    "right-click" is your friend!
    - Right-click the Y axis and select "duplicate axis" to create an additional Y axis. Now right-click that new axis and select "swap side" for your convenience...
    - Show the plot properties. Right-click the plot and select your "Y axis" to attach the plot to...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

Maybe you are looking for