LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modify xy graph type definition

The default type definition of XY graph is a 1d array of cluster. And there are only two elements, x and y, in each such cluster. In practice this could be expanded to a cluster of three elements, {x, y1, y2}. Further attempt to expand this will result in a error that complains about type conflicts between source and sink. And that makes it difficult if not impossible to draw a multiple plot xy graph where all plots share the same x input that is not evenly distributed. There are some discusstion in the LabVIEW idea exchange such as this one, http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Even-Simpler-Multiplot-XY-graphs/idi-p/1393286. But it does not seem to be implemented yet as to the current LV version. So as a workaround I am wondering if it is possilbe to create a custom control that starts with the default xy graph and has its type definition changed from the default value. By doing that we then should be able to adapt multiple plots as many dimensions as we want.

 

Thanks.

0 Kudos
Message 1 of 14
(3,914 Views)
You just have to build an array of clusters where you wire the same x array.
0 Kudos
Message 2 of 14
(3,909 Views)

But that will have to duplicate x array and waste memory. What I am trying to do is to use the x array only once and let all other y array elements of the cluster to share it. And that is why I would like to try modifying the type defition of the xy graph to adapt to this.

0 Kudos
Message 3 of 14
(3,906 Views)
You can't modify the xy graph. As you already noted in the link to the Idea Exchange, the suggested change has not been implemented.
0 Kudos
Message 4 of 14
(3,900 Views)

Actually I don't want to modify this built-in control. Instead I would like to create a new one with this as a prototype. The new "xy graph" will then have different type difinition that work for my purpose.

0 Kudos
Message 5 of 14
(3,896 Views)

@stevensung wrote:

So as a workaround I am wondering if it is possilbe to create a custom control that starts with the default xy graph and has its type definition changed from the default value. By doing that we then should be able to adapt multiple plots as many dimensions as we want.


This needs to be implemented under the hood, so the xy graph cannot be used for this. You are free to draw your own xy-graph from scratch using e.g. a 2D picture indicator.

 

 

0 Kudos
Message 6 of 14
(3,895 Views)

Well this approach seems feasible but quite difficult. Is there any tutorial of this so that I coudl follow to have this creation of new xy graph control completed?

 

Thanks,

0 Kudos
Message 7 of 14
(3,877 Views)

Not really, unless you have all the "Under the hood" magic (or can duplicate it) that converts the data to lines for your display withou (say) wasting a ton of memory drwaing thousands of points per pixel.

 

My guess is that, if you shut off debugging and let the compiler optimize the code anyway the X data buffer will be reused.Smiley Wink

 

Thats a complete guess but the compiler is getting pretty smart.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 14
(3,870 Views)

Currently posting by phone, cannot check, but there are some shipping examples.

 

Just don't expect any savings in memory use. I still think this is a non-issue.

0 Kudos
Message 9 of 14
(3,869 Views)

OK, back on a computer....

 

For some ideas, open the example finder and look at the example "XY Multi Plot" for an exampple how to make your own graph using a picture indicator.

0 Kudos
Message 10 of 14
(3,860 Views)