VegaLite.data_from_values

You're seeing just the function data_from_values, go back to VegaLite module for more information.
Link to this function

data_from_values(vl, values, opts \\ [])

View Source

Specs

data_from_values(t(), Table.Reader.t(), keyword()) :: t()

Sets inline data in the specification.

Any tabular data is accepted, as long as it adheres to the Table.Reader protocol.

Options

  • :only - specifies a subset of fields to pick from the data

All other options are converted to data properties.

Examples

data = [
  %{"category" => "A", "score" => 28},
  %{"category" => "B", "score" => 55}
]

Vl.new()
|> Vl.data_from_values(data)
|> ...

Note that any tabular data is accepted, as long as it adheres to the Table.Reader protocol. For example that's how we can pass individual series:

xs = 1..100
ys = 1..100

Vl.new()
|> Vl.data_from_values(x: xs, y: ys)
|> ...

See the docs for more details.