LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

chart legends, only one showing on stripchart

Solved!
Go to solution

1. I selected 4 legends on my stripchart, but see only "Trace 1." No other legends are visible. How to get them visible?

 

2. How to change the text of each legend? I tried the following before and after the PlotStripChart statement but don't see the INK#X texts, just a single "Trace 1" legend.

 

        SetPlotAttribute (g_hmainPanel, SS_PANEL_STRIPCHART, 0, ATTR_PLOT_LG_TEXT, "INK#1");
        SetPlotAttribute (g_hmainPanel, SS_PANEL_STRIPCHART, 1, ATTR_PLOT_LG_TEXT, "INK#2");
        SetPlotAttribute (g_hmainPanel, SS_PANEL_STRIPCHART, 2, ATTR_PLOT_LG_TEXT, "INK#3");
        SetPlotAttribute (g_hmainPanel, SS_PANEL_STRIPCHART, 3, ATTR_PLOT_LG_TEXT, "INK#4");

 

I do get all four traces showing on the stripchart.

 

Any ideas?

 

Thanks,

John

0 Kudos
Message 1 of 2
(3,136 Views)
Solution
Accepted by QuerulousJohn

Hi QuerulousJohn

 

In order to get the various elements showing in your legend, you can select the .uir, double click your strip chart to edit its attributes. Select Traces, and then if you notice you can select the number of traces as well as which one you are looking at. To get each of the four showing on your legend you need to toggle "Trace on Legend" in the bottom left corner for each of the ones you want to show.

 

For setting the text of each item in your legend you can actually use SetTraceAttributeEx (panelHandle, PANEL_CHART, 1, ATTR_TRACE_LG_TEXT, "text");

 

Where the parameters are the panel, the chart/control ID, which trace you are referencing, the attribute, and the value.

 

Hopefully that should get things working for you, definitely follow up if it is not the solution to your issue.

 

Have a great day!

James W.
Applications Engineer
National Instruments
Message 2 of 2
(3,119 Views)