question

Mischa Spelt avatar image
0 Likes"
Mischa Spelt asked Jordan Johnson edited

How to plot all columns vs. time?

Hi,

I've created a statistics collector that listens to a single event and collects a few different numbers.

I wanted to create a simple plot that shows all these values as different series in the same plot, as in the below (Excel scatter) plot, but I could not figure out how to do it easily in FlexSim.

I ended up writing a calculated table with a UNION to manually pivot the table, but that was not my preferred solution :-)

SELECT Time, "Items" AS Type, Items AS [Count] FROM [Throughput]
UNION
SELECT Time, "Size units" AS Type, Size FROM [Throughput]

Surely there's a nice solution for this? :-)

FlexSim 20.1.3
flexsim 20.1.3chartscontent vs time chart
1593095901859.png (34.6 KiB)
1593095958780.png (25.7 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

tannerp avatar image tannerp commented ·
I think that your calculated table solution is actually the only way to do this as of now. The chart you're using currently only supports one column for Y-values based on my testing. @Jordan Johnson can correct me if I'm off.
0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Jordan Johnson edited

The easiest way is to change your stats collector. I would listen to the same event multiple times, once for each stat.

Once you've made that table, you should be able to chart it with no problem. This is also easier (and much, much better for performance) than writing a query.

Here's an example model, that uses a timer event; but the principles are the same:

MutliStatExample.fsm

You could also do it with a single event, and create an array of row values (to create multiple rows per event), and also write some if/else code in your column value to write a different value depending on the row value. But this way is a little more straightforward.


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.