Skip to main content
Version: Java (Groovy)

piePlot

The piePlot method creates category histograms using data from Deephaven tables.

Syntax

piePlot(seriesName, t, categories, y)
piePlot(seriesName, categories, y)
piePlot(seriesName, sds, categories, y)

Parameters

ParameterTypeDescription
seriesNameString

The name (as a String) you want to use to identify the series on the plot itself.

tTable

The table that holds the data to be plotted.

sdsSelectableDataSet

A selectable data set (e.g., OneClick filterable table).

categoriesString

The name of the column in t or sds to be used for the categories.

categoriesIndexableData

Data.

categoriesList<T>

Data.

categories<T>[]

Data.

yString

Column in t or sds containing numeric data.

ydouble[]

Numeric data.

yfloat[]

Numeric data.

yint[]

Numeric data.

ylong[]

Numeric data.

yshort[]

Numeric data.

yList<T>

Numeric data.

y<T>[]

Numeric data.

Returns

A pie chart.

Examples

The following example plots data from a Deephaven table.

import static io.deephaven.csv.CsvTools.readCsv

totalInsurance = readCsv("https://media.githubusercontent.com/media/deephaven/examples/main/Insurance/csv/insurance.csv")

regionInsurance = totalInsurance.view("region", "expenses").sumBy("region")

pieChart = piePlot("Expense per region", regionInsurance, "region", "expenses")\
.chartTitle("Expenses per region")\
.show()