Chart

interface Chart<DOMAIN> : EventListener<DOMAIN> , ChartController<DOMAIN>

The Chart class is the main entry point when creating a chart, use the VizContainer.chart function to create one.

Functions

addMark
Link copied to clipboard
common
abstract fun addMark(markCreator: MarkCreator<DOMAIN>)
Add a Mark to the current chart.
config
Link copied to clipboard
common
abstract fun config(init: ChartConfig.() -> Unit)
Allow to override the default config or the config passed into the Chart.
highlight
Link copied to clipboard
common
@JvmName(name = "highlightDomains")
abstract fun highlight(domains: Collection<DOMAIN>)
Highlight the given DOMAIN objects.
@JvmName(name = "highlightData")
abstract fun highlight(data: Collection<Datum<DOMAIN>>)
Highlight the given Datums.
legend
Link copied to clipboard
common
abstract fun legend(init: Legend<DOMAIN>.() -> Unit)
The Legend initialization DSL.
onHighlight
Link copied to clipboard
common
abstract fun onHighlight(listener: (event: HighlightEvent<DOMAIN>) -> Unit)
Add a listener on a HighlightEvent.
onPan
Link copied to clipboard
common
abstract fun onPan(listener: (event: PanEvent) -> Unit)
Add a listener on a PanEvent.
onSelect
Link copied to clipboard
common
abstract fun onSelect(listener: (event: SelectEvent<DOMAIN>) -> Unit)
Add a listener on a SelectEvent.
onZoom
Link copied to clipboard
common
abstract fun onZoom(listener: (event: ZoomEvent) -> Unit)
Add a listener on a ZoomEvent.
pan
Link copied to clipboard
common
abstract fun pan(panX: Percent, panY: Percent)
Move the "viewport" of the Chart by a certain percentage in X or Y direction.
pushEvent
Link copied to clipboard
common
abstract fun pushEvent(event: ChartEvent)
Push a ChartEvent on the Chart.
select
Link copied to clipboard
common
@JvmName(name = "selectDomains")
abstract fun select(domains: Collection<DOMAIN>)
Select the given DOMAIN objects.
@JvmName(name = "selectData")
abstract fun select(data: Collection<Datum<DOMAIN>>)
Select the given Datums.
tooltip
Link copied to clipboard
common
abstract fun tooltip(init: Tooltip<DOMAIN>.() -> Unit)
The Tooltip initialization DSL.
viewReset
Link copied to clipboard
common
abstract fun viewReset()
Reset the view, setting the pan and zoom to their origin values.
zoom
Link copied to clipboard
common
abstract fun zoom(zoomOriginX: Percent, zoomOriginY: Percent, zoomFactorX: Percent, zoomFactorY: Percent)
Zoom the "viewport" of the Chart by a certain percentage in X or Y direction, knowing the zoom origin.

Properties

config
Link copied to clipboard
common
abstract val config: ChartConfig
The main configuration object ChartConfig, stores all configurations for the underlying marks, axes, ...
dataset
Link copied to clipboard
common
abstract val dataset: Dataset<DOMAIN>
The Chart, a data container giving access to all the original data and several useful properties.
series
Link copied to clipboard
common
abstract var series: Discrete<DOMAIN, *>
The series Discrete dimension is used to "split" your data into multiple series allowing to display them differently.
size
Link copied to clipboard
common
abstract var size: Size
The external size of the chart.
title
Link copied to clipboard
common
abstract var title: String?
Give a title to your Chart.
zoom
Link copied to clipboard
common
abstract val zoom: Zoom
The current Zoom for this Chart.

Extensions

area
Link copied to clipboard
common
fun <DOMAIN, YVAL> Chart<DOMAIN>.area(x: Quantitative<DOMAIN>, y: Discrete<DOMAIN, YVAL>, init: AreaMark<DOMAIN, Double?, YVAL>.() -> Unit = {})
Add an AreaMark to the current Chart.
fun <DOMAIN, XVAL> Chart<DOMAIN>.area(x: Discrete<DOMAIN, XVAL>, y: Quantitative<DOMAIN>, init: AreaMark<DOMAIN, XVAL, Double?>.() -> Unit = {})
Add an AreaMark to the current Chart.
bar
Link copied to clipboard
common
fun <DOMAIN, YVAL> Chart<DOMAIN>.bar(x: Quantitative<DOMAIN>, y: Discrete<DOMAIN, YVAL>, init: BarMark<DOMAIN, Double?, YVAL>.() -> Unit = {})
Add a horizontal BarMark to the current Chart.
fun <DOMAIN, XVAL> Chart<DOMAIN>.bar(x: Discrete<DOMAIN, XVAL>, y: Quantitative<DOMAIN>, init: BarMark<DOMAIN, XVAL, Double?>.() -> Unit = {})
Add a vertical BarMark to the current Chart.
boxPlot
Link copied to clipboard
common
fun <DOMAIN, XVAL> Chart<DOMAIN>.boxPlot(x: Discrete<DOMAIN, XVAL>, y: Quantitative<DOMAIN>, init: BoxPlotMark<DOMAIN, XVAL, Double?>.() -> Unit = {})
Add a vertical BoxPlotMark to the current Chart.
fun <DOMAIN, YVAL> Chart<DOMAIN>.boxPlot(x: Quantitative<DOMAIN>, y: Discrete<DOMAIN, YVAL>, init: BoxPlotMark<DOMAIN, Double?, YVAL>.() -> Unit = {})
Add a horizontal BoxPlotMark to the current Chart.
constant
Link copied to clipboard
common
fun <DOMAIN, VALUE> Chart<DOMAIN>.constant(constantValue: VALUE, init: Constant<DOMAIN, VALUE>.() -> Unit = {}): Constant<DOMAIN, VALUE>
Create a Constant dimension for the Chart.
discrete
Link copied to clipboard
common
fun <DOMAIN, VALUE> Chart<DOMAIN>.discrete(accessor: Datum<DOMAIN>.() -> VALUE, init: Discrete<DOMAIN, VALUE>.() -> Unit = {}): Discrete<DOMAIN, VALUE>
Create a Discrete dimension for the Chart.
empty
Link copied to clipboard
common
fun <DOMAIN, XVAL, YVAL> Chart<DOMAIN>.empty(x: Dimension<DOMAIN, XVAL>, y: Dimension<DOMAIN, YVAL>, init: EmptyMark<DOMAIN, XVAL, YVAL>.() -> Unit = {})
Add an EmptyMarkImpl to the current Chart.
line
Link copied to clipboard
common
fun <DOMAIN, XVAL, YVAL> Chart<DOMAIN>.line(x: Dimension<DOMAIN, XVAL>, y: Dimension<DOMAIN, YVAL>, init: LineMark<DOMAIN, XVAL, YVAL>.() -> Unit = {})
Add a LineMark to the current Chart.
plot
Link copied to clipboard
common
fun <DOMAIN, XVAL, YVAL> Chart<DOMAIN>.plot(x: Dimension<DOMAIN, XVAL>, y: Dimension<DOMAIN, YVAL>, init: PlotMark<DOMAIN, XVAL, YVAL>.() -> Unit = {})
Add a PlotMarkImpl to the current Chart.
quantitative
Link copied to clipboard
common
fun <DOMAIN> Chart<DOMAIN>.quantitative(accessor: Datum<DOMAIN>.() -> Double?, init: Quantitative<DOMAIN>.() -> Unit = {}): Quantitative<DOMAIN>
Create a Quantitative dimension for the Chart.
temporal
Link copied to clipboard
common
fun <DOMAIN> Chart<DOMAIN>.temporal(accessor: Datum<DOMAIN>.() -> Instant, init: Temporal<DOMAIN>.() -> Unit = {}): Temporal<DOMAIN>
Create a Temporal dimension for the Chart.