MartinMcD Posted January 22, 2011 Report Share Posted January 22, 2011 Hello everyone, I'm trying to think of a way of replacing the numerical values on the x axis of my plot below with text. The graph can be resized by the user and the number of bars changes as well. I've thought of an array of fill slides instead of a plot but they don't resize as nicely. My preferred option at the moment is an array of strings which I position under the x axis of the plot. This would work if there was a way of resizing the element width at runtime. Does anyone know of a way of tackling this please? I'll keep searching and post back if I figure it out. Thank you, Martin Perhaps I could use VI Scripting to the create/destroy the number of string controls that I need and then position the controls based on the width of the plot and the number of bars shown. I'm yet to try VI Scripting though... Quote Link to comment
MartinMcD Posted January 22, 2011 Author Report Share Posted January 22, 2011 It is a bit inelegant but I have come up with a solution. I create 10 string controls (more than I think I'll need) and get references to them. I then position each of the ones I need based on the range of the x axis and then hide the ones I don't want. A bit messy but it works fine. Quote Link to comment
ShaunR Posted January 22, 2011 Report Share Posted January 22, 2011 It is a bit inelegant but I have come up with a solution. I create 10 string controls (more than I think I'll need) and get references to them. I then position each of the ones I need based on the range of the x axis and then hide the ones I don't want. A bit messy but it works fine. You could draw your own axis using the 2D picture plot functions (2D picture plot). The downside is you don't get all the zoom candy etc. Quote Link to comment
Grampa_of_Oliva_n_Eden Posted January 22, 2011 Report Share Posted January 22, 2011 You could draw your own axis using the 2D picture plot functions (2D picture plot). The downside is you don't get all the zoom candy etc. Like he said. Ben See here Quote Link to comment
MartinMcD Posted January 23, 2011 Author Report Share Posted January 23, 2011 Ahh yes, thank you that is a nice idea and beats having hidden indicators floating around my front panel. Thank you for the tip! Regards, Martin Quote Link to comment
Popular Post jdunham Posted January 24, 2011 Popular Post Report Share Posted January 24, 2011 You could also use graph cursors or annotations, and position them just under your bars. That would look decent enough if you set the Yscale min to -1 rather than zero, and then you could put the labels at Y = 0.5 or something. You'd fill the bars down to zero rather than down to -infinity. You would have a few compromises with the appearance, but the zooming &c.would all work. Bar Graph With X Labels.vi 3 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.