entriesOf

fun entriesOf(vararg pairs: Pair<Number, Number>): List<FloatEntry>

Creates a List of FloatEntry instances. Each of the provided Pairs corresponds to a single FloatEntry, with the first element of the Pair being the FloatEntry’s x coordinate, and the second element of the Pair being the FloatEntry’s y coordinate.

Example usage:

entriesOf(0 to 1, 1 to 2, 3 to 5)

The provided Number instances will be converted to Float instances.

See also


fun entriesOf(vararg yValues: Number): List<FloatEntry>

Creates a List of FloatEntry instances out of an array of y-axis values.

The following are equivalent:

entriesOf(1, 2, 5)
entriesOf(0 to 1, 1 to 2, 2 to 5)

An x-axis value will be automatically assigned to each y-axis value from yValues. The x-axis value will be equal to the y-axis value’s index in yValues.

The provided Number instances will be converted to Float instances.

See also