10-25-2018 06:47 AM - edited 10-25-2018 07:00 AM
Hello,
The graph control right-hand Y-axis tick marks just to the left of the numeric values that make up the scale look like negative signs. This causes significant confusion. Just for this reason, I am not able to use the graph control of the LabWindows CVI !
As far as I know, similar questions appeared here in the past but i could not see proper solutions so far in the forums. I believe it must be very easy to fix this for the programmers of the NI , but no solution so far
I am currently using LabWindows 2017 and the same problem still continues...
Is there a solution to this terrible issue??
Solved! Go to Solution.
10-26-2018 04:28 AM
I see what you are concerned of and even if I'm not so upset by this situation I understand this may be not good for you. Nevertheless I see no solution for this with the standard graph control. What I may suggest you is a workaround that adds a second scale to the left of the graph:
This workaround implies a bit of effort to sync the two axes scales. This image is really composed of three elements: the main graph, the supplementary graph used just for the scale and the underlying decoration if you need it.
This solution is used in my example program Multiple Axis in a Graph Using LabWindows/CVI
10-26-2018 04:35 AM - edited 10-26-2018 04:41 AM
A few seconds after I posted the previous message, a quicker and dirtier solution came to my mind: use a dummy text message to hide the tick marks! See the image below: the upper graph is the final solution, in the lower one the two dummy messages are highlighted to demonstrate what I'm speaking about:
Note: this solution can be a hassle if you give your user the ability to resize the panel. If this is the case, you can manipulate the text messages relying on ATTR_PLOT_AREA_XX (top/left/height/width) attributes of the graph control after the resizing has terminated
10-26-2018 05:38 AM
...the same (hassle) is true if your axis is set to autoscale or may change programmatically, say from 100 to 1000 because this results in a change of the plotting area
10-26-2018 09:24 AM
@Wolfgang ha scritto:
...the same (hassle) is true if your axis is set to autoscale or may change programmatically, say from 100 to 1000 because this results in a change of the plotting area
Well, this could be overcome by setting ATTR_FIXED_PLOT_AREA attribute to TRUE and leaving enough room for the scale changes by appropriately setting ATTR:PLOT_AREA_XX attributes.
10-26-2018 04:23 PM
Dear RobertoBozzola,
Using dummy text boxes to hide the tick marks overcomes the problem for sure in appearance. However, when I want to transfer the graph to a Word report via Clipboard, the dummy boxes will not be transferred. Merging the graph and the dummy boxes in the Clipboard is beyond my reach for the time being.
I simply use the following code to put the graph into the clipboard:
GetCtrlDisplayBitmap (tabPanelHandle_MAINSCREEN, MAINSCREEN_TESTGRAPH, TRUE, &bitmapID)
ClipboardPutBitmap(bitmapID);
Using “PrintScreen” button and extracting the graph seems like a solution but exhausting and time-consuming when there are many graphs to be reported.
I think I should firstly try your first solution that adds a second scale to the left of the graph.
Thanks again
10-29-2018 06:20 AM
Having two graphs to transfer in your report could be a hassle as well! Additionally I don't feel good having the screen aspect of the graph on a printed paper, it looks... how to say... not so professional in my opinion.
In these cases, I normally have a separate panel (not shown to the user) customized for printing: white background, no menu bar, white or transparent graph edge and so on. Next I plot data to the that graph and include panel bitmap in the report. This method could be used both for dummy-text-messages and two-graphs solution
10-30-2018 01:54 PM - edited 10-30-2018 02:05 PM
Dear Roberto,
I have implemented your final solution, which includes a hidden separate panel customized for printing, along with dummy text boxes. Now, the graph is put into the clipboard without confusing tick marks. It is working well and I have been satisfied with the result. This seems like the best solution.
Thank you for your assistance
10-31-2018 02:59 AM
An additional note:
Setting ATTR_FIXED_PLOT_AREA attribute to TRUE and making the “precision” of the graph scales constant are very essential for the effectiveness of the solution, as this was emphasized by Roberto earlier.
02-17-2019 08:30 AM
I have just realized that the above solution is screen-resolution dependent! As a further solution, the “resolution adjustment” feature of the panel that carries the graph must be changed to zero as seen in the attachment.
After this final change, the solution works flawlessly regardless of the screen resolution.