layerLabels

class layerLabels(variables: String)

Configures annotations (for pie chart). Defines the content and format for displaying the value.

Examples

val data = mapOf("name" to listOf("a", "b", "c", "d", "b"), "value" to listOf(40, 90, 10, 50, 20))
letsPlot(data) +
geomPie(
size = 15, hole = 0.2,
labels = layerLabels("..proppct..").format("..proppct..", "{.1f}%").size(15)
) { fill = asDiscrete("name", orderBy = "..count.."); weight = "value" }

Parameters

variables

Variable names to place in the annotation with default formatting. Useful for specifying the annotation content quickly, instead of configuring it via the line() method.

Constructors

Link copied to clipboard
constructor(vararg variables: String)

Functions

Link copied to clipboard
fun format(field: String, format: String): layerLabels

Defines the format for displaying the value. The format will be applied to the corresponding value specified in the line template.

Link copied to clipboard
fun line(template: String): layerLabels

Specifies the string template to use in the annotation.

Link copied to clipboard
fun size(value: Number): layerLabels

Specifies a text size in the annotation.