AnyLogic
Expand
Font size

Updating charts

Charts can be updated with new values in several ways:

  • Automatic update. New data samples are added automatically with the specified time period. The expressions defined for data items are evaluated dynamically during the simulation and the resulting data values are fed into the charts.
  • “Manual” update. New data samples are added “manually” by the user. The user calculates new values elsewhere and feeds it to a chart using the corresponding API.

Updating charts you may also update the value of displayed analysis data objects.

Those expressions are dynamically evaluated to obtain the values of the data items.

Automatic update

Use this mode if you wish to add new data samples periodically with the well-known recurrence. In this case the data item’s expression is evaluated dynamically with the specified time period and the resulting value is displayed on the chart.

Automatic update applies to all displayed data sets/data items.

To turn automatic update on

  1. Select the chart in the graphical editor by clicking it.
  2. Go the Properties view.
  3. In the Data update section, choose Update data automatically option and then enter the update rate in the Recurrence time edit box below. Also, you can define here whether you want to Use model time or Use calendar dates. Depending on this choice, you can specify when updating begins with either First update time or Update date properties.

If you do not want to update your charts automatically, you can turn auto update off.

To turn automatic update off

  1. Select the chart in the graphical editor by clicking it.
  2. Go to the Properties.
  3. In the Data update section, choose Do not update data automatically option.

“Manual” update

You can update charts with new data samples from your code by calling the function updateData(). This function updates all data items/data sets displayed by the chart.

How can we improve this article?