Pie grid
As the name suggests, a pie grid is a grid of small single-value pie charts. Here is a simple example:
Parameters
- data
List[dict], DataFrame, Series Contains inline data to use for the chart. In Markdown, the value must be a JSON string representing a list of dictionaries, as shown in the example below. Each dictionary must contain a
labelelement, with the label for the respective slice, and avalueelement, representing the extent of the slice (which will be scaled appropriately).In Python,
datamay be any of:- A Python list of dictionaries, as above
- A Pandas, FireDucks, Polars or pyarrow DataFrame with a
labelandvaluecolumn. - A Series whose index supplies the labels and entries supply the value.
- label
string - value
string If you would like to use different columns instead of the standard "label" and "value" columns, you may specify one or both using the
labeland/orvalueparameters like this:html<piegrid data='[ { "category": "Apples", "value": 10 }, { "category": "Bananas", "value": 20 }, { "category": "Cherries", "value": 15 }, { "category": "Grapes", "value": 25 } ]' width=500 height=150 colors='deep' label='category' > </piegrid>- columns
integer Specifies the number of pie charts per row. The default is 3.
- show_percentages
Boolean If true, the percentage that the value is of the sum of the values is added to the chart.
- bg_arc_color
string - text_color
string - percent_color
string - total_color
string The colors of the chart elements may be specified using these four optional parameters. The meanings of each parameter are as follows:
Param Default Component bg_arc_color#2b2b2f The portion of the circle not representing the value text_color#aaa The color of the label text percent_color#eb0707 If show_percentistrue, the color of its texttotal_color#aaa The color of the value text
In addition to all of the standard parameters the following apply to pie charts.