LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

The graph control right-hand Y-axis tick marks look like negative signs

Solved!
Go to solution

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??

0 Kudos
Message 1 of 11
(5,384 Views)

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:

 

Screenshot 2018-10-26 11.10.48.png

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



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 11
(5,359 Views)

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:

 

Screenshot 2018-10-26 11.29.42.png

 

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



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 11
(5,357 Views)

...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

0 Kudos
Message 4 of 11
(5,351 Views)

@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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 11
(5,347 Views)

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

0 Kudos
Message 6 of 11
(5,336 Views)
Solution
Accepted by Soydan

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

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 7 of 11
(5,303 Views)

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

0 Kudos
Message 8 of 11
(5,282 Views)

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.

0 Kudos
Message 9 of 11
(5,267 Views)

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.

Message 10 of 11
(5,065 Views)