[graph] deleted plots are drawn till resize of graph

I work on CVI2012SP1 and I´m having some trouble with the graph control.
As the stripchart control does make to much trouble for me I went with the graph control to display a moving chart. This works much more painless than with the stripchart, but now I got another problem with drawing the plots.
I´m deleting all plots and then adding new ones. Then I call RefreshGraph() and the new plot is drawn, but also is the old plot (see the screenshot)!? If I resize the graph only the current plot is drawn.
Why is this so? Is this a bug? How can I work around it?
Solved!
Go to Solution.
Attachments:
Fehler Graph Zeichnen.jpg ‏467 KB

I don´t know if I understood you right.
This is a stripped down example of the code I use:
// Graph nicht zeichnen
SetCtrlAttribute(panel->panelHandle,g_scGraphContr​olIds[CTRL_GRAPH_CHART],ATTR_REFRESH_GRAPH,0);
// alte Plots entfernen
DeleteGraphPlot(panel->panelHandle,g_scGraphContro​lIds[CTRL_GRAPH_CHART],-1,VAL_IMMEDIATE_DRAW);
// aktive Y- Achse setzen
SetCtrlAttribute(panel->panelHandle,g_scGraphContr​olIds[CTRL_GRAPH_CHART],ATTR_ACTIVE_YAXIS,VAL_RIGH​T_YAXIS);
// Plots eintragen
for(int sensor = 0; sensor < 8; sensor++)
int colorTrace;
int colorMinMax;
// Farben festlegen
if(panel->showTrace[sensor])
colorTrace = g_GraphTraceColors[sensor];
if(panel->showMinMax[sensor])
colorMinMax = g_GraphTraceColors[sensor];
else
colorMinMax = VAL_TRANSPARENT;
else
colorTrace = VAL_TRANSPARENT;
colorMinMax = VAL_TRANSPARENT;
// Value Plot zeichnen
panel->plotHandle[sensor * 3] = PlotXY(panel->panelHandle,g_scGraphControlIds[CTRL​_GRAPH_CHART],g_sGraphXBuffer,valueBuffer[sensor],​numPointsChart,VAL_INTEGER,VAL_DOUBLE,g_GraphLineT​hickness,VAL_NO_POINT,VAL_SOLID,1,colorTrace);
// Min Plot zeichnen
panel->plotHandle[sensor * 3 + 1] = PlotXY(panel->panelHandle,g_scGraphControlIds[CTRL​_GRAPH_CHART],g_sGraphXBuffer,minBuffer[sensor],nu​mPointsChart,VAL_INTEGER,VAL_DOUBLE,g_GraphLineThi​ckness,VAL_NO_POINT,VAL_SOLID,1,colorMinMax);
// Max Plot zeichnen
panel->plotHandle[sensor * 3 + 2] = PlotXY(panel->panelHandle,g_scGraphControlIds[CTRL​_GRAPH_CHART],g_sGraphXBuffer,maxBuffer[sensor],nu​mPointsChart,VAL_INTEGER,VAL_DOUBLE,g_GraphLineThi​ckness,VAL_NO_POINT,VAL_SOLID,1,colorMinMax);
// Graph zeichnen
SetCtrlAttribute(panel->panelHandle,g_scGraphContr​olIds[CTRL_GRAPH_CHART],ATTR_REFRESH_GRAPH,1);
RefreshGraph(panel->panelHandle,g_scGraphControlId​s[CTRL_GRAPH_CHART]);
 As said, if I replace the "VAL_IMMEDIATE_DRAW" with "VAL_DELAYED_DRAW" the old plots are drawn until I resize teh graph.
As I see it, I´m not reusing the plot handles, but getting new ones for every change (of the data) I make.

Similar Messages

  • Delete Plot Area in Mixed Signal Graph

    Hi,
    I would like to delete not needed graphs and groups in Mixed Signal Graph but I see when I right click on the graps the Delete Plot Area is disabled and grayed. Could you please let me know how can I delete plots and groups in MIxed Signal Graph.
    Thanks

    Sorry, too snarky.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • How do I change the number of plot areas in a Mixed Signal Graph

    How do I *programatically* change the number of plot areas in a Mixed  Signal Graph?  I recognize that the developer can choose to add or  remove a plot area during edit mode but I want to select between 2 or 3 visible plot areas and scale the plot areas appropriately.  Is there a property that tells me how many plot areas (or yscales) there are?  I also need a property that I can write to as to set the number of plot areas available.
    Aside from manually making too many plot areas and then hiding the unneeded plot areas how can I do this?
    Jonathan

    Hello,
    I don't think that is possible - I searched the property and invoke nodes but didn't find something to do that.  This would make a great product suggestion though, which you can submit (it goes directly to R&D) by clicking the word feedback in the bottom left corner of the Contact NI page linked below:
    Contact NI:
    http://sine.ni.com/apps/utf8/nicc.call_me
    Best Regards,
    JLS

  • How to get a fixed plot area in a Waveform Graph even if the Y scale's precision change

    Because I'm stacking many Waveform Graph. I want them to look the same. When I change the precision of the values in the Y Scale. The plot area doesn't keep its initial width. In the example provided. I'm changing the precision and you can see it moving. Is there a way to keep the width fixed?
    I noticed that there is justification for unit label. But I didn't got the expected behavior.
    Attachments:
    ScaleProblem.vi ‏38 KB

    The menu item is only in LabVIEW 6.1 and above because the plot area did not autoscale in earlier versions so I'm not sure exactly what kind of problem you're seeeing. Here's the original example in 6.0 format and when I run it, the plot areas stay aligned as the precision changes. Could you maybe post an example that demonstrates the behavior?
    Attachments:
    ScaleProblem[1].vi ‏33 KB

  • Problem with printing graph larger than screen size in labview6 (plots are shopped).

    I have attached with my message the report I try to print. It is a Labview 6 vi.
    I had no problem with Labview 5. But with Labview 6, the plots are shopped (all the rest of the report is correct). What is printed is not what I see.
    The graph is intentionnaly built very large, then rescale to fit page, in order to improve the print quality of the plots. I repeat it, it worked fine with Labview 5.
    Thanks if you can help.
    Lionel.
    Attachments:
    Print_of_large_scale_graph.vi ‏284 KB

    Hi Lionel,
    I experienced a similar problem days ago: re-compiling a vi from LV 5.1 to LV 6.0.2 its front panel could not be printed anymore; no error, just a blank sheet.( The mass compile procedure did not reported any error).
    The only way to get out from this headache was to re-build the vi in LV 6.0.2, I simply selected all its diagram and copied it in a new vi, saved it and I got print-outs!
    Try it.
    Good luck,
    Alberto

  • Does anyone know why the mixed signal graph stops allowing traces to be drag'ed and dropped between different plot areas?

    I have a mixed signal graph that allows me to drag and drop my traces between the plot areas,  then it stops allowing it.
    If I start with a new graph it allows it but eventually stops allowing it.
    I have 4 XY charts feeding the one mixed singal graph through a bundle function, then I run it once and drag my traces to the correct plot area
    and hope that it keeps working.
    Best Regards
    Tim C.
    1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!

    Hi Tim,
    That sounds like some interesting behavior.  Can you reproduce what you were seeing, or have you continued to be able to drag the signals to other plots since you saved and reopened your program? 
    Jennifer R.
    National Instruments
    Applications Engineer

  • Can I change the order plots are written to an XY graph without changing their order in the plot array?

    In LV6.1 the order in which plots are written to an XY graph is in reverse order from the order they appear in the array of plots that is feed to the XY graph control. Thus at places where �Plot 0� intersects �Plot 1�, the �Plot 0� data appears in front of the �Plot 1� data. I would like to reverse this without switching the order the plot array is built-up. Is this possible? I�ve attached a vi that demonstrates what I�m taking about. In my application I have many �highlights� that I do NOT want to list in the plot legend but that I wish to plot �over� the channel data that IS listed in the legend.
    Thanks
    Attachments:
    plotOrder.vi ‏42 KB

    Thanks for this idea. I misunderstood what you meant until Jeremy responded saying you were �right on the money�. I thought you meant that putting another plot in the array but making it transparent was going to help somehow, but now I understand that you mean plotting the �up front� data to a separate XY graph indicator which is transparent and overlaying the original XY graph. I may wind-up doing this. I�m just not excited about linking all the scaling info from one graph to the scaling of the transparent graph and creating the necessary event handling so that when the user scales one graph or changes the auto-scaling, the other graph�s scales gets updated, but perhaps it�s the only way. Thanks again for your input.

  • Change display size of plot area

    I have a VI that is reading signals from 16 different channels. The signals recorded from each of the 16 channels are displayed on 16 different graphs. I want to be able to see all 16 channels at the same time, in case anything interesting happens on any one of them, so each graph is fairly small.(See the attached screenshot.)
    When something interesting does happen, I want to be able easily resize the entire plot area to cover most of the screen--perhaps with the click of a mouse. I would then like to be able to put it back to normal size--perhaps also with a single click of the mouse, or something equivalently as easy.
    Simply zooming in on the "interesting region" will not do.
    Is there a way to easily resize plot areas--b
    y pushing a single button on the keyboard or mouse?
    Attachments:
    labview-screenshot.jpg ‏117 KB

    I would do it like this: Have a main loop that updates the graphs. Have a second loop that has an event structure that looks for button presses. If the user clicks on a graph, the second loop launches a second VI. This VI has its properties set to show front panel when called (File -> VI Properties... -> Windows Appearance -> Customize...) and Close afterwards if originally closed. It front panel basically just your graph and a waveform graph reference (which I hide). It has a loop and an event structure that keeps updating until the graph is clicked. When the graph is clicked, the VI closes. Your original VI needs to keep updating during this and it updates the big graph through a control reference. I have attached an examp
    le.
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]
    Attachments:
    aaaBig_Graph.vi ‏32 KB
    aaaSmall_Graphs.vi ‏263 KB

  • Keeping plot area, legend and legend within same area

    I have two xy graphs, arranged one below another. Both have legends and multiple yscales (depending on user selection using popup menu). Yscales are shown programmatically and so is legend text (which varies in length). Legend is on right of plots. What I need to do is resize the plotting part of the xy graph to accomodate the legend, when its text increases in size (and it moves left onto the graph). The lower graph's plotting part shoudl also acquire the same size.That is the total control area should not increase (lets say 1200 pixels in width) and plotting area should shrink or enlarge to accomodate the increasing yscales (on the right side) or legend size.
    Please share a VI that does so.
    Thanks

    Well, this seems to do what you want. IMHO, it's not pretty, and I bet it could be made better (if it could, I'm sure we'll find out, BRING IT ON!). Autosize your legend if you want, I wanted to show how things would vary. You could then just wire the second graph to have the same size properties as the first.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Plot area width changes as the precision changes !?

    need help to understand following thing:
    If I increase the precision of a graph manually, the plot area size decreases and vice versa.
    Otherwise there is an example posted demonstrating prcision change by property node which does not change plot area size.
    I've attached an example to demonstrate both.
    What I want is to change the precision manually with the default graph tools without decrease or increase plot area width.
    Is this possible in LV 6.02 ?
    Attachments:
    MyScaleProblem.vi ‏60 KB

    Hi.
    Resizing of the graph is the default behavior. The Graph resizes in LabVIEW 7 in both cases. I woud suggest building a text indicator with a transparent background and reading the properties of the graph to display the correct values to the side. This should give the desired response.
    -Erik

  • How to make the plot area of a xy transparant?

    I want to use a image to use as background of a xy graph so I want to make the plot area transparant

    hi there
    use the color - Tool, select transparent for background and foreground color and click on the control.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • How to get ONLY the data shown in the plot area (Chart)

    My chart history length are 120000, often I don't need to save the whole
    buffer, just the data shown in the plot area?
    Richard Pettersen

    Hi Richard,
    you haven't said which version of LabVIEW you're using, so I've assumed 6.1, although this should be fine for older versions too.
    I put down a chart with a scrollbar, so I could go through the old data, and put an indicator attached to the x-scale->Range->minimum and x-scale->Range->maximum. These followed the displayed elements in the chart as I scrolled through the data. You can therefore link in the chart history (history data property of the chart) with a array subset to retrieve the appropriate portion.
    Be aware though. The minimum and maximum that the chart is showing on the x-scale may not be a part of the history data. E.g. if I set the history length to 1000 points, and produce on the first run, 1000 points, then my minimum and maximum are a
    t say 899 and 999. I then produce a second set of data, 1000 points long, and my min and max move to 1899 and 1999. As my history data is only 1000 long, I can scroll back to 1000 OK, but my min and max used as indexes don't relate anymore. The array of data is from 0 to 999, but my indexes can run from 1000 to 1999. So I have to add in a check that sees how much data is available before attempting to index, and then it's down to the flow of the program to try to work out where the data actually is (I'll leave that one to you - you'll need to keep track of the history data compared to the maximum (shown just after a point is added though this then makes a mess of your data! - possible to keep a track of new minimum when adding new data : the maximum (which will show once new data goes on) minus the history length gives the minimum that can be scrolled to - subtract this from all max's and min's to get real offset into the data - history length can be got from the history data and an a
    rray size sub .vi)
    Obviously there's no problem if you're clearing the graph everytime you either plot new data, or reach maximum capacity on the history data as the indexes return to zero.
    Hope that helps
    S.
    // it takes almost no time to rate an answer

  • Chart Plot-area layoutBounds - how do you reveal them ?

    How do you return the x/y coordinates of the Plot-Area rectangle from a simple XYChart ? I have tried returning them via the Chart's Plot variable (using the Container layoutBounds variable) but Plot is a 'protected variable' and I'm unable to compile the code as a result.

    It doesn't matter now.  They finally fixed it but the time was far too
    long for me not to have all the service I'm paying for.
    Nevertheless the phone # is <Personal information deleted per the TOS>
    What you really need to resolve is why it is so difficult to report a
    network problem.
    BTW the I posted the ticket number and someone at your end scrubbed it.
    <Personal information such as the phone number and ticket number is not to be posted on the public forum per the Verizon Wireless Terms of Service and should only be shared through a private "Direct Message" (DM for short).>
    Message was edited by: Verizon Moderator

  • How to delete sales area of an Account in Web UI?

    Hi All,
    I want to delete a sales area associated with an account, (i.e Not entire sales area from Organization structure) just delete the link with account.
    I don't have an option to delete sales area associated with account in CRM Web UI. So we refer some SAP recommendations for deleting sales area and then I got these notes SAP Note 1906379 and 725857.
    From the above mentioned notes I can only perform deleting sales area dependent data, but not the entire sales area link as such from business partner.
    We do not have an ECC system,please suggest me some possible solutions for this issue.
    Thanks!!!!
    Regards
    Mukesh.L

    Hi Aaron Smith,
    It will be great, if you guide us in how to delete the sales area of a business partner from Web UI.
    I had tried SAP Note 1906379 and 725857 but i still can't delete sales area as such from business partner.
    Your response is much appreciated!!!!

  • Charts: how do I determine when the mouse is in the plot area

    I'm trying to implement logic that will do the following:
    Panning plot within plot display area by clicking and dragging mouse
    If the user clicks and drags in the chart plot area (the region where the chart plot actually displays, not including the axes, legends, titles, etc.), I want to be able to provide the effect of panning the plot (e.g. similar to grabbing and dragging a map in Google maps) within the plot display. This makes the most sense, of course, if the user has zoomed in to some level and the entire plot is no longer fully visible within the display.
    Zooming on a plot
    If the user places the mouse somewhere in the chart plot area and uses their mouse wheel, I want to be able to provide the effect of zooming in and out of the plot. The plot area itself must remain at its original size, just the representation of the plot needs to simulate the effect of being zoomed in or out on.
    Thoughts, suggestions, ...
    To make the zoom and pan effect, my thought was to adjust the axes bounds as appropriate to simulate these effects. The trick for some of what I'm planning on doing is finding out where the mouse is in the plot area (not the whole chart) so that I can find the x,y offsets from the plot origin (which appears to be in the upper left - at the chart level anyway). For panning, I don't think I care what the offset is, just that it's within the plot. For zooming, I may need to know where the mouse is in the plot so that the zooming could be centered on that location in the plot. This makes me think that it would also be helpful to find out how to translate the mouse x,y pixel position to a corresponding x,y value in the plot data domain.
    I've been experimenting with attaching event handlers to detect various mouse actions and what information can be gleaned from these events. So far I have not found anything that allows me to determine the bounds of the plot region in the overall chart. I can get the mouse x,y position, but I don't know where it is in relation to the plot area bounds. I don't want to initiate a pan of a plot if the user happens to drag their mouse somewhere outside the plot area (i.e. over an axis, legend, etc.). Also, it would not make sense to start a zoom on the chart unless the mouse is over the plot.
    Please let me know if this seems to be a reasonable approach, and if not, please suggest any ideas for alternatives. Any help, ideas and suggestions regarding how to solve these issues and/or determine this information would be welcome.

    I experimented a bit and it seems the plot-content is the Group containing, well, the content of the plot. So in a line chart it's the smallest rectangle containing all the lines and the graphic at the data point (little circles, by default). What you probably need instead is the chart-plot-background.
    Here's a quick example of a panning chart. There are probably better ways to manage the mouse dragging (it behaves somewhat badly if you drag out of the plot area and then back in, for example) but it gives you the basic idea. My original idea of adding a mouse directly to the plot area failed as the event doesn't get propagated to the plot region if you click on part of the plot content (a line, for example).
    import java.util.Random;
    import javafx.application.Application;
    import javafx.beans.property.DoubleProperty;
    import javafx.beans.property.SimpleDoubleProperty;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.event.EventHandler;
    import javafx.geometry.Point2D;
    import javafx.scene.Scene;
    import javafx.scene.chart.LineChart;
    import javafx.scene.chart.NumberAxis;
    import javafx.scene.chart.XYChart.Data;
    import javafx.scene.chart.XYChart.Series;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.Region;
    import javafx.stage.Stage;
    public class PanningChart extends Application {
      @Override
      public void start(Stage primaryStage) {
        final NumberAxis xaxis = new NumberAxis("x", 0, 10, 1);
        final NumberAxis yaxis = new NumberAxis("y", 0, 100, 10);
        final LineChart<Number, Number> chart = new LineChart<>(xaxis, yaxis);
        chart.setAnimated(false);
        chart.setData(createData());
        final Region plotArea = (Region) chart.lookup(".chart-plot-background");
        final DoubleProperty lastMouseX = new SimpleDoubleProperty();
        final DoubleProperty lastMouseY = new SimpleDoubleProperty();
        chart.setOnMousePressed(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            final double x = event.getX();
            final double y = event.getY();
            if (plotArea.getBoundsInParent().contains(new Point2D(x, y))) {
              lastMouseX.set(x);
              lastMouseY.set(y);
        chart.setOnMouseDragged(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            final double x = event.getX();
            final double y = event.getY();
            if (plotArea.getBoundsInParent().contains(new Point2D(x, y))) {
              moveAxis(xaxis, x, lastMouseX);
              moveAxis(yaxis, y, lastMouseY);
        final BorderPane root = new BorderPane();
        root.setCenter(chart);
        primaryStage.setScene(new Scene(root, 600, 400));
        primaryStage.show();
      private void moveAxis(NumberAxis axis, double mouseLocation,
          DoubleProperty lastMouseLocation) {
        double scale = axis.getScale();
        double delta = (mouseLocation - lastMouseLocation.get()) / scale;
        axis.setLowerBound(axis.getLowerBound() - delta);
        axis.setUpperBound(axis.getUpperBound() - delta);
        lastMouseLocation.set(mouseLocation);
      private ObservableList<Series<Number, Number>> createData() {
        final ObservableList<Data<Number, Number>> data = FXCollections
            .observableArrayList();
        final Random rng = new Random();
        for (int x = 0; x <= 10; x++) {
          data.add(new Data<Number, Number>(x, rng.nextDouble() * 100));
        return FXCollections.singletonObservableList(new Series<Number, Number>(data));
      public static void main(String[] args) {
        launch(args);
    998038 wrote:On a slightly different (but related) subject, where can I find an up-to-date source of information that describes the IDs and class names that JavaFX uses? I assume the ".plot-content" is pertaining to the ID of the chart plot area (or plot "child" of the chart?). Where can I find the names of the various objects that can be "looked up"?I generally try to avoid lookups as they feel a bit fragile. However occasionally there seems to be no other way, as in this case. The [url http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html]CSS reference guide documents the css class substructure of each Node type.

Maybe you are looking for