ActiveX 3D Graph Shows Wrong Colors of Points on LabVIEW

Updated Dec 4, 2023

Reported In

Software

  • LabVIEW

Operating System

  • Windows

Issue Details

I am using an ActiveX 3D Graph. I give 3 arrays as input where each of them is the red, green and blue values of RGB colors. I use these arrays as the coordinates of my points on the graph and I would like to display these points according to their RGB colors (defined by the coordinates of the point).
There is a problem with the resulting graph where most of the color of the points I am inputting are wrong. Some are correct. 

Solution

Microsoft deprecated ActiveX controls, therefore it is not recommended to use ActiveX controls in LabVIEW. However, a workaround for this is using scatter graphs. 
The use of scatter graphs here is recommended because scatter graphs are LabVIEW controls unlike the ActiveX graph.
 To do what is required using a scatter graph, please follow the steps below:

  1. Scatter graphs do not use RGB colors, they use a color ramp per plot. This means there is no way to have more than one point per plot, and there will be as many plots on the graph as there are points. And for each point, the color ramp will consist of only one color which the RGB color that is defined by the coordinates of that point.
  2. Scatter graph property nodes will allow the change to the plot number and color ramp.
  3. Use the 3D Scatter Plot Helper VI.
  4. A for loop will run the code as many times as there are inputs on the three coordinate arrays.

ActiveX Colors.png
NoteIn order to use this snippet, download this image, and then drag and drop it on your LabVIEW block diagram.

By using the above VI and following the mentioned steps, you will be able to draw as many points as you need with their separate colors on a single graph using multiple plots.

Additional Information

One downside to this method is the fact that more points means more graphs, which leads for a linear increase in the amount of time it takes for the code to finish.