Jump to content

Chart plot color change mid-stream


Recommended Posts

Perhaps this is trivial, but it simplified a design for me.

I needed a graph with two plots to update every 100 msec forever (history of last 1000 points). The user wanted the plot colors to change for sections of the plot to indicate some system information. My previous design used FIFO arrays and a waveform graph to display the plots as separate waveforms. The attached pictures should help clarify.

Today I stumbled onto a much easier method using a waveform chart. Using a 'NaN' constant as a place-holder for the secondary plot color the same user interface requirements were satisfied. Wish I had thought of this before.

Link to comment

Another trick I've used is to run a second plot which gets the value 'NaN' until I want to mark an event in the plotting. I then plot a point at -Inf, followed by +Inf, then return to plotting NaN. This guarantees a vertical line draw that does not affect autoscaling behaviors (nor is it affected by scale changes). The visual effect is to have a hairline vertical marker appear over/under the other trace(s) in the chart at the sample of interest.

Dave

Link to comment

What I'm missing in LabVIEW is the ability you get in .net using Measurement Studio. Where you can override any calls to the Graph, e.g. When a plot point gets drawn you can check for some criteria and just change the color or shape of the point.

post-941-1209608924.png?width=400

:rolleyes: --Mike

Link to comment

QUOTE (David Boyd @ Apr 30 2008, 06:22 PM)

Another trick I've used is to run a second plot which gets the value 'NaN' until I want to mark an event in the plotting. I then plot a point at -Inf, followed by +Inf, then return to plotting NaN.

Oh - that's purdy! :thumbup:

Link to comment

QUOTE (David Boyd @ Apr 30 2008, 06:22 PM)

Another trick I've used is to run a second plot which gets the value 'NaN' until I want to mark an event in the plotting. I then plot a point at -Inf, followed by +Inf, then return to plotting NaN. This guarantees a vertical line draw that does not affect autoscaling behaviors (nor is it affected by scale changes). The visual effect is to have a hairline vertical marker appear over/under the other trace(s) in the chart at the sample of interest.

Dave

Dave, while you were plotting -Inf and +Inf on the second plot, what did you do with the first plot? Didn't this mess up the timescale for the first plot data?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.