Help - Pie chart label

From TreeGraph help
(Redirected from Pie chart labels)

A pie chart label is one type of label which is able to display a pie chart near a branch, which is based on the values of several node/branch data columns. Its formats can be adjusted using the element formats dialog. Pie chart labels can e.g. be used to visualize ancestral character state probabilities on internal nodes.

ArticleOnLatestVersion.png This article describes this feature for the latest version of TreeGraph 2. For older versions the following articles are available:
Pie chart label (until 2.12.0)

Note that pie chart labels were not available before version 2.0.43.

Source data

Every pie chart labels stores a set of data IDs which reference either hidden node/branch data or text labels. The sectors of the pie chart represent the numerical values stored in the referenced node/branch data columns linked to the node or branch this label is displayed on. (The values do not have to be standardized to 1. If a value for one ID is missing on the current node or a textual value is referenced it is assumed to be zero.)

When a new pie chart label is created a list of data IDs can be provided (see below). Furthermore the source data IDs can be edited later on by selecting one or more pie chart labels and using the "Edit pie chart data ID(s)..." function from the edit menu or the context menu.

The "New pie chart label(s)"-dialog

Inserting and editing pie chart labels

Creating new labels

New pie chart labels can be inserted into a document by choosing "New" → "New pie chart label(s)..." from the edit menu or the context menu when at least one branch is selected. To insert multiple labels in one step a set of branches can be selected before performing this operation. The "New pie chart label(s)" dialog can then be used to specify the label ID and the title of the new pie chart label(s). In addition a list of data columns can be added. For each column the ID of the source node/branch data column and an optional name (caption) can be specified.

Formats like the label position, the line formats, the section colors or additional pie chart labels formats can be adjusted later using the element formats dialog.

The "Edit pie chart data IDs and captions dialog"-dialog

Editing existing labels

Existing pie chart labels can be edited by selecting one or more of them and choosing "Edit pie chart data IDs and captions..." from the edit menu or the context menu. The dialog that appears here is similar to the New pie chart label(s) dialog but contains no components to edit the title or the label ID of the pie chart. These can be edited using the options "Edit text..." and "Change label ID..." from the edit menu respectively. (See Editing text element values and Changing a document element ID for further details.) Formats can be changed using the element formats dialog.

In order to change the caption of a data column simply select it in the list, edit the text and press the Replace button. The order of the data can also be changed using the Move up and Move down buttons. Note that changing the order of the data does not change the order of the colors associated with the label. Therefore the same data column will be displayed using a different color after changing the order as long as the color order is not edited as well using the element formats dialog.

Formats

"Icon/pie chart label formats"-tab in the element formats dialog

A pie chart label is both a label and a line element, so that label formats and line formats can be applied to it. Furthermore the following formats are available:

Dimensions

  • Width: The width of the pie chart.
  • Height: The height of the pie chart.

Note that it is advisable to set equal width and height, since pie charts would not be circular otherwise. (Although displaying ellipsoidal pie charts is generally possible, it should be noted that only the angle and not the area of section would correspond to the displayed data value in such cases.)

Pie chart specific formats

Sector colors

This list allows you to specify the colors for each sector. Double click the entries to change a color. (Every time a new data ID is added, a default color is used which can later on be changed here.)

Show internal lines

Determines whether lines between the sectors shall be drawn. They have the line width and color which was specified in the line formats tab of the element formats dialog. (A border line around the whole diagram is independently drawn. If you do not want this, you can set to line width to zero.)

Show sectors with a value of 0

Indicates if a line shall be drawn for sectors which represent a value of zero.

Show title

Check this option if the title of a label shall be displayed on its top. Each pie chart label stores a title that can be set using the new pie chart label(s) or the edit text dialog.

Show captions

The options in this list allow to select if captions for the single sections should be displayed left and right of the pie chart. The following options are available:

  • Do not show any captions: Only the chart will be displayed.
  • Show sections names: A name will be displayed for each section. These names can be set when editing a pie chart label.
  • Show section value: The value from the source node/branch data column that determines the size of the section will be displayed. The decimal format of these captions can be changed when clicking the caption text formats button, while the decimal formats that can be set in the element formats dialog directly only affect a possible numeric title of the pie chart.
  • Show section names and values: This a combination of the latter two options. The values will be displayed in parenthesis behind the section names.

Caption link type

The option selected here is only relevant if any type of caption is displayed as specified using the show captions option above. If captions are visible you can chose from different options how to assign a caption to its corresponding pie chart section. The different options have advantages and disadvantages depending on the number and size of the sections to be labeled.

  • Straight lines to chart sections: A straight line will be drawn from the caption directly into the chart section. This link type will clearly show the assignment if there are not too many sections and they each of them is not too small. This option can be problematic of pie chart are labeled that contain many thin sections that are lying closely together. In such cases lines may cross each other.
  • Horizontal lines to chart section: In contrast to the latter option lines will move horizontally out of the chart before turning to the caption. This makes sure that lines never cross each other and therefore this option can be used to label a larger number of relatively small sections. Anyway lines may lie close together in special cases which could make the assignment difficult to recognize.
  • Boxes in the colors of the chart sections: This option displayed a box in the same color as the chart section next to each caption. No lines into the chart will be drawn. This option allows to label a potentially large number of section, even if some or many of them are only small or even have a width of zero. On the other hand it should be noted that the assignment is indirect and therefore may be less clear to the viewer in cases where there would be enough space for lines.
PieChartCaptionsLinkTypeDemo.png
The "Pie chart label captions text formats"-dialog

Caption text formats

By clicking the button "Change caption text formats..." a dialog opens that allows to adjust the text formats of the captions. Note that the text height of the captions is always calculated from the chart height and cannot be specified here. The following tabs are available:

Changes made in this dialog (by clicking OK or Apply) will only be applied to the document if either OK or Apply are also clicked in the element formats dialog afterwards. If the Caption text formats dialog is closed using its Cancel button, all changes made in it will be ignored, even if OK or Apply will be clicked in the element formats dialog later.

Note that the element formats dialog contains the same tabs, but these are used to format the pie chart title and not the captions.

Example

The following tree is taken from a publication of Preußing et al. and shows how pie chart labels can be used to display the results of an ancestral state reconstruction, where the single pies indicate the probabilities of the different states in internal nodes. Three different characters are shown.

PieChartLabelExample.png

Legend

PieChartLabelExampleCaptions.png

Such legends can automatically be created with TreeGraph 2 since version 2.13.0. See Creating label captions for details.

Citation

Preußing M, Olsson S, Schäfer-Verwimp A, Wicket N, Wicke S, Quandt D, Nebel M (2010). New insights in the evolution of the liverwort family Aneuraceae (Metzgeriales, Marchantiophyta), with emphasis on the genus Lobatiriccardia. Taxon 59, 1424–1440.

See also