07-22-2008 01:29 PM
07-22-2008 03:49 PM
07-23-2008 04:22 PM
Hello hendra@ngms,
Thank you for posting to the NI Discussion Forums. I’m glad that you have found the Interactive Legend to be useful. Here are some answers to your issues:
1. The strip chart legend background can be set to transparent, using a line of code similar to the following:
SetCtrlAttribute (panelHandle, PANEL_STRIPCHART, ATTR_LEGEND_PLOT_BGCOLOR, VAL_TRANSPARENT);
The legend frame color can also be set to transparent, using the same command, only setting the ATTR_LEGEND_FRAME_COLOR attribute instead.
2. In order to change the font shown in the legend, you must change it for each plot that is represented in the legend, using SetPlotAttribute(), and changing the Legend Plot Text Font attribute (ATTR_PLOT_LG_FONT).
I agree that it would be nice to be able to directly change the font size here. Luckily, all is not lost. You can still use CreateMetaFont() to specify a point size, style (i.e. bold, italic, etc.) and then set the plot font (using SetPlotAttribute()) to the newly created font.
3. The size and position of the Legend can be controlled programmatically as well, again using SetCtrlAttribute(). The following properties correspond to size and position of the legend:
ATTR_LEGEND_AUTO_SIZE
ATTR_LEGEND_HEIGHT
ATTR_LEGEND_LEFT
ATTR_LEGEND_TOP
ATTR_LEGEND_WIDTH
It is true that the legend moves away from the strip chart when the chart is resized. This is to avoid any overlapping of the two, so that the legend does not hide behind the chart and leave the developer wondering where it went off to.
4. You can distinguish different traces by changing the color, line style, thickness, markers (as you mentioned above) and plot style for each trace. These are also changed using the SetPlotAttribute() command.
It is true that you must have the legend visible for the user to really know which plot corresponds to which trace.
5. I am not clear on the problem you are having with the x-axis data on the chart. The x-axis is labeled by default, but if you right-click on the chart and select Edit Control…, and then select X-axis… from the Edit Strip Chart dialogue, you can edit the parameters of the chart. Be sure that the box next to Show Labels is checked. The x-axis data for the plot can also be accessed programmatically using the GetPlotAttribute() function.
If you do have any product suggestions, we welcome them at our Product Suggestion Center. We do take good look at these before adding features to future releases of our products. Thanks for the feedback!
07-24-2008 10:06 AM
07-24-2008 04:15 PM
hendra@ngms,
Attached is a project I created in LabWindows/CVI version 8.5, as well as the associated source, header, and UIR files. Run the project and see how you can, in fact, make the legend transparent.
The “markers” I was referring to is just the “Point Style” attribute under SetPlotAttribute(). Sorry if I was a little misleading with my lingo.
As far as displaying the trace number directly next to the plot on the strip chart, I do not believe there is any such functionality that exists right now. Your best option would be to differentiate the plots by setting different attributes (as mentioned in point #4 of my previous post), and using the legend as a reference to see which plot corresponds to which trace.
The x-axis data for the plots are attributes of the plots, not the strip chart. If you want to get the x-axis data from the plot, then use the GetPlotAttribute() function (as mentioned in point #5 of my previous post). You will see that one of the available attributes is “X Data”. If it is the range of the x-axis being displayed on the chart you are interested in, then you can use the GetAxisScalingMode() command to extract this data (for all axes). This is also demonstrated in the attached example program. Press the plot button repeatedly, and observe that as the displayed range moves, the maximum and minimum values are displayed in the fields below the chart.
07-25-2008 08:46 AM
07-25-2008 09:15 AM
07-25-2008 09:29 AM
hendra@ngms,
It's true, the text goes transparent as the legend goes transparent. If you want to have the text to appear without a frame, you can try setting the color of the legend to be the same as the panel. See the modified example (attached) to see what I am talking about.
07-25-2008 10:59 AM
07-25-2008 12:01 PM
hendra@ngms,
This was reported to R&D (# 1212007) for further investigation. Please use the solution from my previous post as a possible work-around.
As for the PrintCtrl() issue, please continue to refer to the issue on its original forum: Questions about PrintCtrl()
Thanks again for the feedback!