Engaging plots, made easy.

Easily turn your data into engaging visualizations. Powerful API for coders. Powerful app for everyone.

from plotapi import Chord

Chord(matrix, names).show()

Visualizations Pie Fight

Node text and values

Let's take a look at how we can change the presentation of the text and values in our Pie Fight diagram.

Sample data

Let's import PlotAPI and load our sample data.

from plotapi import PieFight

samples = [
    {"order": 0, "name": "Sankey", "value": 10},
    {"order": 0, "name": "Terminus", "value": 12},
    {"order": 0, "name": "Chord", "value": 8},
    {"order": 0, "name": "Bar Fight", "value": 9},
    {"order": 0, "name": "Pie Fight", "value": 12},

    {"order": 1, "name": "Sankey", "value": 18},
    {"order": 1, "name": "Terminus", "value": 24},
    {"order": 1, "name": "Chord", "value": 22},
    {"order": 1, "name": "Bar Fight", "value": 14},
    {"order": 1, "name": "Pie Fight", "value": 17},

    {"order": 2, "name": "Sankey", "value": 24},
    {"order": 2, "name": "Terminus", "value": 40},
    {"order": 2, "name": "Chord", "value": 32},
    {"order": 2, "name": "Bar Fight", "value": 19},
    {"order": 2, "name": "Pie Fight", "value": 42},

    {"order": 3, "name": "Sankey", "value": 32},
    {"order": 3, "name": "Terminus", "value": 62},
    {"order": 3, "name": "Chord", "value": 40},
    {"order": 3, "name": "Bar Fight", "value": 25},
    {"order": 3, "name": "Pie Fight", "value": 64},

    {"order": 4, "name": "Sankey", "value": 32},
    {"order": 4, "name": "Terminus", "value": 75},
    {"order": 4, "name": "Chord", "value": 55},
    {"order": 4, "name": "Bar Fight", "value": 45},
    {"order": 4, "name": "Pie Fight", "value": 120},


Next, we'll start customizing the node text and values. PlotAPI Pie Fight values can be modified with the values_as_percentage, show_values, show_names, show_lines.

Show values as percentage

Values can be displayed as percentages with the values_as_percentage parameter.

PieFight(samples, values_as_percentage=True).show()
PlotAPI - Pie Fight Diagram

Show or hide values, names, and lines

Visibility of values, names, and their lines can be controlled with show_values and show_lines.

PlotAPI - Pie Fight Diagram

Value suffix

The value suffix can be modified with value_suffix. This is set to value_suffix="%" when values_as_percentage is set to True.

PieFight(samples, value_suffix="!").show()
PlotAPI - Pie Fight Diagram
Pie Fight