04-14-2014 10:56 AM - edited 04-14-2014 10:58 AM
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.
04-14-2014 11:18 AM
04-14-2014 11:21 AM
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.
04-14-2014 11:34 AM
04-14-2014 11:38 AM
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.
04-14-2014 11:40 AM
@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.
04-14-2014 12:50 PM
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,
04-14-2014 12:58 PM
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.
Thats a complete guess but the compiler is getting pretty smart.
04-14-2014 12:58 PM
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.
04-14-2014 01:18 PM
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.