How to add statistics behaviour on custom component

Hi. I’m struggling to get statistics behaviour to work on my custom made lift component. I can’t get the variables for example Statistics.PartsEntered to update.

When I add this Statistics behaviour do I need to activate it some how in the script?
I’ve tried to search help, this forum and academy but I couldn’t find anything related.
Thanks in advance!

Sorry forgot pictures

Hi @Unnahi

As said in the help file, the statistics behavior allows you to collect and report statistics generated by other behaviors in a component during a simulation.
In order to report statistics a behavior needs to have a Statistics property or else you can use a Python Script to manually define data collection.

Thus, you need to connect the statistics behavior with other behaviors that you want to monitor. For example, the default ASRS crane has a path behavior that is connected to statistics behavior
as shown below.

Thanks @Este!
Conection to Path was what I was looking for.


Follow up question to this statistics behaviour.

Can I change plot colors? Thank you in advance!

Changing the data series colors is only possible through the API.

Here is an example of how to do it through a python script.

from vcScript import *
import vcVector

app = getApplication()
dashboard = app.Dashboard
tab = dashboard.Tabs[0] #First tab
chart = tab.Charts[0] #First chart
series = chart.Series[0] #First data series in chart
color =, 0, 1) #RGB, 0..1
series.Colors = [color]
1 Like

Thank you very much! :pray: