AnyLogic 9
Expand
Font size

Pie chart

The pie chart displays the contribution of several data items into a total as sectors of a circle. The sector arcs are proportional to the corresponding data item values. The data items in this chart cannot take negative values. If the total of all data items is 0, no sectors are displayed.

A pie chart in AnyLogicPie chart

To create a pie chart

  1. Drag the Icon: Pie chart Pie Chart element from the  Analysis palette into the graphical editor.
  2. In the Data section of the chart’s Properties, configure the data item.
  3. Specify the title for the data item in the Title box. This text will be shown in the chart legend.
  4. Enter the expression that will be dynamically evaluated to obtain the current value of the data item in the Value box.
  5. Specify the color for this data item’s bar. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.

When finished, specify additional data items you want to be displayed in your chart.

To add a data item

By default, a new pie chart already has two data items. If you want to add another, follow these steps:

  1. Select the pie chart in the graphical editor or in the Projects view.
  2. Go to the Data section of the Properties view.
  3. Click the  Add button. A new property section with settings for one more data item will appear below.

To remove a data item

  1. Select the pie chart in the graphical editor or in the Projects view.
  2. Go to the Data section of the Properties view.
  3. Locate the section defining the data item you want to remove from the pie chart.
  4. In this section, click the  button.

Properties

General

Name — The name of the chart. The name is used to identify and access the chart from the code.

Ignore — If selected, the chart is excluded from the model.

Lock — If selected, the chart is locked, so it could not be selected in the graphical editor with a mouse click. Model developers would not be able to move it, resize, or modify its properties anyhow, unless the chart is unlocked.

Data

Depending on the type of the chart, one or more data items may already be present in its properties.

 Add — This button opens a new property section, which allows for configuring the data you want to visualize on this chart.

Title — The title for this data item. It will be shown in the chart legend.

Value — The expression which dynamically evaluates the data item value.

Color — The color of the data item value on the chart. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.

Use the  and  arrows to arrange the order of the data item sections.

To remove the data item from the chart, click the  button below the data item’s property section.

Data update

Update data automatically — If selected, new data samples will be added automatically with the specified Recurrence time. You can also specify whether you want to Use model time or Use calendar dates. Depending on this choice, you can specify when to start updating using either the First update time or Update date properties.

Legend

Show legend — If selected, the chart legend is displayed.

Position — [Enabled if Show legend is selected] Sets the legend position (relative to the chart).

Area size — [Enabled if Show legend is selected] The size of the area allocated for the chart legend.
For the North and South positions, this setting affects the area’s height. For the East and West positions, this setting affects the area’s width.

Text color — The color of the legend’s text. Click the colored box to choose the custom color using the color picker.
To adjust the text’s transparency, use the edit box on the color picker’s right.

Appearance

Background color — The background color of the chart. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.

Border color — The chart border color. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.

Position and size

Level — The level this chart belongs to.

X — The x-coordinate of the chart’s upper left corner.

Y — The y-coordinate of the chart’s upper left corner.

Width — The width of the chart shape (in pixels).

Height — The height of the chart shape (in pixels).

Chart area

This section defines the visual properties of the chart area.

X Offset — The x-offset of the chart area relative to the whole area allocated for the chart and all its accompanying elements.

Y Offset — The y-offset of the chart area relative to the whole area allocated for the chart and all its accompanying elements.

Width — The width of the chart area (in pixels).

Height — The height of the chart area (in pixels).

How can we improve this article?