04-02-2013 12:40 PM
Hi -
I need to add a Y-vs-T chart recorder to my app. It needs to represent 200 time points, and 60 values on the Y axis. No zooming, scrolling or anything fancy is needed.
Should I just use PlotXY with a shifted buffer every time I want to plot a new point, or is there some slicker way to do this? I don't think the program will have trouble keeping up with the changing data, so I'm mostly concerned with coding efficiency and elegance here.
Solved! Go to Solution.
04-02-2013 12:52 PM
The magic word is strip chart...
04-02-2013 01:07 PM
I looked at the help entries for strip charts -- that looks like exactly what I need. I don't find a way to create one from the UI building tool, though. Do I just create a regular graph, and then plot to it with the strip chart control functions?
04-02-2013 01:11 PM
in the edit / graph menu of the UI editor there are three entries, I'd suggest the second one
04-02-2013 09:06 PM
Excellent. Thanks, Wolfgang. A couple of questions:
1. is there no way to change the color of the trace when in VAL_CONTINUOUS scroll mode?
2. I want my plot to be 200 pixels wide. I see how to set the size of the entire graph, but how do I change just the plot area?
Thanks...that's a very nice feature.
04-03-2013 12:46 AM
1) Did you try ATTR_TRACE_COLOR?
2) The frame width automatically adjusts to axes labels (number of digits...) etc. So the only way (I am aware of) to have a given plot area is to minimize the frame, i.e. no ticks etc.
04-03-2013 01:42 AM
Have you tried with ATTR_PLOT_AREA_TOP, _LEFT, _HEIGHT, and _WIDTH attributes of SetCtrlAttribute? I have not tried them with strip chart but the online help applies those attributes to that control too. They work well with graphs.
04-03-2013 01:49 AM
Ha, Roberto, thank you for reminding me!
04-03-2013 11:50 AM
Thanks for the replies, guys. the SetTraceAttribute command didn't seem to work, though it didn't return an error code, either. (I made an assumption that my trace number was 1...it's the only trace on this graph.)
I played with the various size attributes and got the plot area looking better. It takes a little experimenting with the overall graph size vs. the plot size to get things right. But, I think it's reasonable now. I'd greatly appreciate any and all feedback on how this looks overall...
04-03-2013 12:48 PM
Are you saying that SetTraceAttribute (panel_handle, control_id, 1, ATTR_TRACE_COLOR, VAL_RED); didn't work? It should! It does for me...