Bargraph w/ Label
bcirrisi
Junior Member
Does anyone know if there is a way to have a bargraph (level) with some text that moves with the on state? I draw a picture of what I want it to kind of look like.
Has this been discussed before?
Thanks,
Has this been discussed before?
Thanks,
Comments
-
Sure, create 2 levels using the same level number for each level display. In the one you want the % to appear type $P% in the text field in both states and in the bargraph level just do it normally.
-
That seems to give me the proper percentage, but doesn't move up/ or down with the level. It's staying at the middle of the level (50%) and just changing the %.
-
Sure, create 2 levels using the same level number for each level display. In the one you want the % to appear type $P% in the text field in both states and in the bargraph level just do it normally.
I think he wants the percentages to move WITH the bargraph (always in the same position - either on top of the bar or inside it but on top.)
I don't have a panel to try it so I could very well be wrong. -
I don't think that's what he's asking, he wants the justification of the text to change based on what the bargraph value is, so that the location of the number appears to move up and down with the bar. I don't know if there is a way to do it short of moving the buttons via code whenever the levels are changed. If there were a way to do it in TPDesign4 I'm not sure what it is, and you probably would have found it already.
edit: what jjames just posted is a lot simpler, use that instead. -
That seems to give me the proper percentage, but doesn't move up/ or down with the level. It's staying at the middle of the level (50%) and just changing the %.
You could always use the absolute text justification command in code.AMX PI wrote:"'^JSB-<variable text address range>,<button states range>,<new text alignment>'"
Set bitmap/picture alignment using a numeric keypad layout for those buttons with a
defined address range (1 = left - top, 5 = center - middle, 9 = right - bottom).
The alignment of 0 is followed by ',<left>,<top>'.
The left and top coordinates are relative to the upper left corner of the button.
Syntax:
SEND_COMMAND <DEV>,"'^JSB-<vt addr range>,<button states range>,<new text alignment>'"
That command could be triggered by a LEVEL_EVENT. -
Great Idea, I'll give it a try now...
-
Great Idea, I'll give it a try now...
Just thought of a small problem.
Since percentages are typically at most 3 digits, you'll need to compensate the left alignment when switching to 1 or 2 or 3 digits.
BTW - if it works, gimme your address and I'll send you a bill for my consultation fees.
(j/k) -
...moving the buttons via code...
Is this even possible? I remember a while back trying to move things around via code - without luck.
If I remember correctly there is no way to re-position a button or even a popup page on the fly. If this is incorrect I'd love to know how it is done. I run across a lot of situations where this would be handy. -
Using the Absolute Justification, then changing the position through code worked.
The real tricky part is that the level starts from 0 (at the bottom) and goes to 255 (at the top). The size of the level box was 180pixels and starts at 0 (at the top) and goes to 180 (at the bottom). So the code needed to scale the position from 255 to 180, then move it relatively from the top not the bottom.
As far as your fee jjames, you mis-lead me, I needed the ^JST command not the ^JSB command. I already filed a complaint with the custom service for my money back.
Thanks for the help! -
Using the Absolute Justification, then changing the position through code worked.
The real tricky part is that the level starts from 0 (at the bottom) and goes to 255 (at the top). The size of the level box was 180pixels and starts at 0 (at the top) and goes to 180 (at the bottom). So the code needed to scale the position from 255 to 180, then move it relatively from the top not the bottom.
As far as your fee jjames, you mis-lead me, I needed the ^JST command not the ^JSB command. I already filed a complaint with the custom service for my money back.
Thanks for the help!
LMAO! Fair enough.
Glad you got it working. -
Why not just add a multistate bargraph with 100 states and the text position Tweened? Overlay this on a regular bargraph?
-
kbeattyAMX wrote: »Why not just add a multistate bargraph with 100 states and the text position Tweened? Overlay this on a regular bargraph?
That's a good idea too. I just prefer to manage things in code - much easier to change in my opinion, but that's just me. -
If this bargraph changes regularly, do you really want all of those send commands going out? I would let the panel do the work.
-
TurnipTruck wrote: »If this bargraph changes regularly, do you really want all of those send commands going out? I would let the panel do the work.
Good point . . . I guess he's in line for a FULL refund.
-
did you get it to work? I would like to see it in action
-
Here is a test file I put together. It has 24 levels that are randomly generated, then it takes the average of all the bar graphs and moves a precision bar graph to the average location. The Average text is positioned next to the Precision indicator and moves up and down with the level. It works great when the average is towards the middle, but when it goes towards the top and bottom it looks off a little.
Even if your not interested in how it works, it's fun to keep hitting the test button! -
Using the Absolute Justification, then changing the position through code worked.
The real tricky part is that the level starts from 0 (at the bottom) and goes to 255 (at the top). The size of the level box was 180pixels and starts at 0 (at the top) and goes to 180 (at the bottom). So the code needed to scale the position from 255 to 180, then move it relatively from the top not the bottom.
As far as your fee jjames, you mis-lead me, I needed the ^JST command not the ^JSB command. I already filed a complaint with the custom service for my money back.
Thanks for the help!
You can change the min and max values of the bargraph in the panel file (programming tab range high and low), or use the ^GLH and ^GLL commands to set them in code (give your bargraph a variable text address)
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums
