ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
|
Downloads |
Tips and Tricks Share helpful modeling ideas |
#1
|
|||
|
|||
Creating a stacked bar chart for the states of multiple objects
The attached model contains a VisualTool with Custom Draw Code found in the object Properties. In this example, draw commands are being used to create a stacked bar chart showing the states of every object that the VisualTool is center connected to. Currently the code only covers IDLE, PROCESSING, BLOCKED, and DOWN states. However, with a little copy-paste you can extend the chart to include other states and have full control of the colors. This is just a start, I'm sure someone can take it further.
Note: I used a VisualTool because of its ability to become a Screen Locked Billboard. Enjoy! |
The Following 14 Users Say Thank You to Kris Geisberger For This Useful Post: | ||
Tom David (04-15-2008) |
#2
|
||||
|
||||
I took Kris' advice and updated the object he started. The code is in the same place and I took the time to comment all of the lines of code so anybody should be able to figure out what is going on.
To use this object you go to its labels and for each state that you want to track replace the zero with a -1 or + number. If you place a -1 the code will use the rank of the state and the colorarray function to set the color for that state. If you place a + number the code will use that number and the collor array function to set the color of the state. Any time that occurs that you have not got a state for will be marked as "Untracked". In the sample model you will see that there is some "Untracked" time. You may also notice that the Travel_Unloaded state has a 3 instead of a -1 for its value. This is because the colorarray for 15 is White and you couldn't see it so I specified a color that was unused. Hope you like it, Brandon
__________________
thats not normal. |
The Following 13 Users Say Thank You to Brandon Peterson For This Useful Post: | ||
Stefan Trabut (05-20-2011) |
#3
|
||||
|
||||
Cool
I'm impressed. Nice job Kris, and thanks for enhancing it Brandon. Maybe others will join in the effort and start making other dynamic charts/graphs with greater flexibility than the ones offered by the Recorder object.
|
#6
|
||||
|
||||
Hey Guys,
Thanks Kris and Brandon. I really like the object. I liked it so much I decided to make a few more tweaks. For those of us who like the sharpness of a graph in 2D as opposed to 3D, I've ported Kris' draw code over to a 2D graph window. I use a graph view, but just use the OnDraw attribute of the graph view to draw my own graph (I don't use any of the standard graph attributes). |
The Following 7 Users Say Thank You to Anthony Johnson For This Useful Post: | ||
Tom David (07-08-2008) |
Thread | Thread Starter | Forum | Replies | Last Post |
Creating DLLs that attach to Flexsim | Anthony Johnson | Wiki Articles | 0 | 01-10-2014 01:11 PM |
can I use an edit box entry to update multiple labels? | KelvinHo | Q&A | 10 | 03-28-2008 07:17 AM |
Flow items with states | AlanZhang | Q&A | 16 | 11-30-2007 10:32 AM |
Creating fsm-Files | Ralfi | Q&A | 4 | 10-16-2007 06:07 PM |
Operators on Multiple Networks | Nico Zahn | Q&A | 0 | 10-10-2007 03:02 AM |