VlChartMark class

One mark and the channels it reads.

Every setter answers the mark, so a mark is written as one sentence.

aggregate, bin, title and the rest apply to the channel most recently named — the cursor — which is what makes that sentence read in the order it is thought. on moves the cursor back to a channel already set.

A channel names a column. A constant goes through valueNumber or valueString, and the two are kept apart on purpose: .color("red") meaning a column called red and .color("#c00") meaning paint it red cannot both be true, and the version that guesses is the one that draws a chart nobody asked for.

See also VlChart.

VlDataset data = VlDataset.create();
data.row().str("region", "North").num("sales", 120.0);
VlChart chart = VlChart.create(data);
chart.bar().x("region").y("sales").aggregate("sum").title("Total sales");

Constructors

VlChartMark()

Properties

cursor String
getter/setter pair
enc VlJson
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
markType String
getter/setter pair
owner VlChart?
getter/setter pair
props VlJson
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

aggregate(String op) VlChartMark
How the rows in each group are reduced to one value.
axisJson(VlJson axis) VlChartMark
Sets the cursor channel's whole axis definition.
axisOrient(String side) VlChartMark
Which side of the plot the cursor channel's axis stands on.
bin() VlChartMark
Bins the cursor channel's column into buckets.
channel(String name, String field) VlChartMark
Sets any channel to a column by name.
chart() VlChart
Returns to the chart, when the next thing to say is about the view.
color(String field) VlChartMark
Colour, and the legend that explains it.
column(String field) VlChartMark
Splits the chart into side-by-side panels, one per value.
cornerRadius(double value) VlChartMark
How rounded the corners of a bar or a rectangle are.
count(String channel) VlChartMark
Sets a channel to a count of rows: one number per group, with no column to read.
cursorChannel() VlJson
detail(String field) VlChartMark
Groups the rows without drawing anything of its own: one line per group, no legend.
encodeJson(String channel, VlJson definition) VlChartMark
Sets a whole channel from an already-built definition.
extent(String value) VlChartMark
What an interval mark is computed from.
fill(String field) VlChartMark
Fill colour, set apart from the outline.
filled(bool value) VlChartMark
Whether the mark is filled or drawn as an outline.
format(String pattern) VlChartMark
The number or date format its axis labels are drawn in.
innerRadius(double value) VlChartMark
The hole in the middle of an arc, which is what turns a pie into a donut.
interpolate(String kind) VlChartMark
How a line joins its points.
keepOrder() VlChartMark
Keeps the order the rows arrived in, rather than sorting alphabetically.
markColor(String value) VlChartMark
Paints every mark one colour, rather than reading a column.
markOpacity(double value) VlChartMark
How opaque every mark is drawn, as one number rather than from a column.
markSize(double value) VlChartMark
How big every mark is drawn, as one number rather than from a column.
maxBins(int count) VlChartMark
Bins the cursor channel's column into at most this many buckets.
noAxis() VlChartMark
Draws the cursor channel without an axis.
noLegend() VlChartMark
Draws the cursor channel without a legend.
noStack() VlChartMark
Draws the marks overlapping rather than stacked.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
note(String message) → void
opacity(String field) VlChartMark
How opaque the mark is.
order(String field) VlChartMark
The order the rows are drawn in, and the order a line joins its points.
orient(String value) VlChartMark
Which way a tick lies, or which way a bar with only one position channel runs.
propFlag(String key, bool value) VlChartMark
Sets any boolean property of the mark itself.
propNumber(String key, double value) VlChartMark
Sets any numeric property of the mark itself.
propString(String key, String value) VlChartMark
Sets any string property of the mark itself.
radius(String field) VlChartMark
How far from the centre an arc reaches.
row(String field) VlChartMark
Splits the chart into stacked panels, one per value.
scaleJson(VlJson scale) VlChartMark
Sets the cursor channel's whole scale definition.
scaleType(String kind) VlChartMark
The kind of scale the cursor channel uses.
scheme(String name) VlChartMark
The colour scheme a colour channel draws from.
setOnCursor(String key, VlJson value) VlChartMark
shape(String field) VlChartMark
The symbol a point is drawn as.
size(String field) VlChartMark
Mark size: the area of a point, the width of a trail.
sortBy(String field) VlChartMark
The order a discrete scale runs in, taken from another column.
stack(String how) VlChartMark
How marks sharing a position are stacked.
stroke(String field) VlChartMark
Outline colour, set apart from the fill.
strokeWidth(double value) VlChartMark
How thick the mark's outline is drawn.
text(String field) VlChartMark
The text a label mark shows.
theta(String field) VlChartMark
The angle an arc covers, which is what makes a pie or a donut.
thickness(double value) VlChartMark
How thick a tick is drawn across its band.
timeUnit(String unit) VlChartMark
Which part of an instant to read: year, month, yearmonth, hours and the rest.
title(String label) VlChartMark
The axis or legend label for the cursor channel.
tooltip(bool value) VlChartMark
Shows every column the mark encodes when the reader points at it.
tooltipField(String field) VlChartMark
Shows one named column as the tooltip.
tooltipFields(List<String> fields) VlChartMark
Shows several named columns as the tooltip, in the order they should be read.
toString() String
A string representation of this object.
inherited
type(String kind) VlChartMark
States what the column holds, when the data cannot say.
valueNumber(String channel, double value) VlChartMark
Sets a channel to a constant number rather than to a column.
valueString(String channel, String value) VlChartMark
Sets a channel to a constant string rather than to a column.
withPoints(bool value) VlChartMark
Draws a line showing the points it was drawn through.
x(String field) VlChartMark
Position along the horizontal axis.
x2(String field) VlChartMark
The far end of a horizontal interval, for a bar, an area or a rule that spans two values.
xOffset(String field) VlChartMark
What separates the bars of a grouped bar chart, across the horizontal axis.
y(String field) VlChartMark
Position along the vertical axis.
y2(String field) VlChartMark
The far end of a vertical interval, for a bar, an area or a rule that spans two values.
yOffset(String field) VlChartMark
What separates the bars of a grouped bar chart, across the vertical axis.

Operators

operator ==(Object other) bool
The equality operator.
inherited