This guide details the terms used for every visual element, note that these elements are tightly tied to the chart's DSL, so knowing them helps you build charts faster.
The Charts.kt DSL makes Chart
the root element of every visualization.
//run highlight-only=true
chart(data) {
// all your chart's code goes here
}
A Mark is a way to represent data, for example, Line, Column, Area... In the previous image, the mark is a PlotMark
, a mark used to create a scatter plot.
There can be several marks in a Chart
like in this image, a BarMark
(in blue) and a LineMark
(in black):
//run highlight-only=true
private fun VizContainer.createChart(data: List<Record>): Chart<Record> =
chart(data) {
(...)
// your first "mark" is a BarMark
bar(dimension1, dimension2)
// your second "mark" is a LineMark, note that it share the same X-dimension
line(dimension1, dimension3)
}
The marker is the visual representation that a Mark
draws to display a single element.
In a scatterplot, the marker would be a single "plot", for a bubble chart, each unique bubble would also be called a marker.
Generally speaking, the task of a mark is to draw markers for every record in your dataset.
The axis is composed of several parts you can customize: