channel method

VlChartMark channel(
  1. String name,
  2. String field
)

Sets any channel to a column by name.

The named channel becomes the cursor, so the next aggregate, title or type applies to it.

name The channel name, as Vega-Lite spells it. field The column name.

Returns This mark, so calls chain.

Implementation

VlChartMark channel(String name, String field) {
  VlJson ch = VlJson.objectValue();
  ch.setMember("field", VlJson.stringValue(field));
  this.enc.setMember(name, ch);
  cursor = name;
  return this;
}