Jump to content

Customise Bar graph


Neil Pate

Recommended Posts

Hi all,

I would like to make a Bar Plot in LabVIEW with the slight difference in that I would like my columns to have a colour gradient to them. All my odd columns will have a certain colour + gradient,and all my even columns will have a different colour + gradient.Ideally also it would be nice to be able to animate the changing heights of these columns.

I can probably do this by using the Graph just for the "frame" and axes etc and then manually drawing in the columns into the FG picture, but seems like a lot of work.

In the attached picture the Graph is generated in LabVIEW (except the middle column I have pasted over from a different application). Ideally I would like to to this all natively in LabVIEW. The previous app was actually LabVIEW but I do not wish to use the old technique as it is very fiddly and totally bloats the application (hint, the column is actually a picture control),

Does anybody have any suggestions?

Graph.png

Link to comment

My first thought - I wonder whether one of the 3D Graph (I find the old NI 3D Graphs a little easier than the rewrite) or 3D Picture controls might work - unfortunately there seems like there might be a fair bit more capability hidden out of sight than can be easily accessed.  At the very least you might be able to appear like a bar has two different colours by an appropriate 3D Bar Plot, even if you don't get the gradient in between.  3D Picture controls are based on OpenGL, so theoretically it should be easy to do what you want there, but I've never had much success doing anything complex with 3D Pictures.

Link to comment

I was going to suggest the 2D picture control anyway.  I mean you probably can do some post processing like get the image of the graph, and then overlay an image of the gradient on top, but I don't think it is all that hard to draw a gradient bar.  Attached is some code that does the trick and pulls code from the dark side.

Gradient Picture Hooovahh.zip

  • Like 1
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.