Package-level declarations

Full-featured chart component based on chart.js library.

Types

Link copied to clipboard
data class AnimationOptions(val duration: Int = 1000, var easing: Eeasing = Eeasing.EASEOUTQUART, val delay: Number? = null, val loop: Boolean? = null, val onProgress: (obj: AnimationEvent) -> Unit? = null, val onComplete: (obj: AnimationEvent) -> Unit? = null, val disabled: Boolean? = null)

Chart animation options.

Link copied to clipboard
data class ArcOptions(val angle: Number? = null, val backgroundColor: Color? = null, val borderAlign: TitleAlign? = null, val borderColor: Color? = null, val borderWidth: Int? = null, val borderJoinStyle: LineJoin? = null)

Chart arc options.

Link copied to clipboard
data class BarOptions(val backgroundColor: Color? = null, val borderColor: Color? = null, val borderWidth: Int? = null, val borderSkipped: SkipMode? = null, val borderRadius: Number? = null, val inflateAmount: Number? = null, val pointStyle: PointStyle? = null)

Chart bar options.

Link copied to clipboard

Border align modes.

Link copied to clipboard
data class BorderOptions(val display: Boolean? = null, val color: Color? = null, val width: Int? = null, val dash: List<Number>? = null, val dashOffset: Number? = null)

Chart border options.

Link copied to clipboard
open class Chart(configuration: Configuration, chartWidth: Int? = null, chartHeight: Int? = null, className: String? = null, init: Chart.() -> Unit? = null) : Widget

Chart component.

Link copied to clipboard
data class ChartFont(val family: String? = null, val size: Number? = null, val style: String? = null, val weight: String? = null, val lineHeight: Number? = null)

Chart font options.

Link copied to clipboard
data class ChartOptions(val responsive: Boolean = true, val aspectRatio: Number? = null, val maintainAspectRatio: Boolean = true, val onResize: (chart: Chart, newSize: ChartSize) -> Unit? = null, val resizeDelay: Int? = null, val devicePixelRatio: Number? = null, val locale: String? = null, val interaction: InteractionOptions? = null, val hover: InteractionOptions? = null, val events: List<String>? = null, val onHover: (event: ChartEvent, elements: Array<ActiveElement>, chart: Chart) -> Any? = null, val onClick: (event: ChartEvent, elements: Array<ActiveElement>, chart: Chart) -> Any? = null, val animation: AnimationOptions? = null, val animations: dynamic = null, val transitions: dynamic = null, val layout: LayoutOptions? = null, val elements: ElementsOptions? = null, val elementsDynamic: dynamic = null, val scales: Map<String, ChartScales>? = null, val scalesDynamic: dynamic = null, val showLine: Boolean? = null, val spanGaps: Boolean? = null, val cutoutPercentage: Int? = null, val circumference: Double? = null, val rotation: Double? = null, val plugins: PluginsOptions? = null, val pluginsDynamic: dynamic = null, val datasets: dynamic = null)

Chart options.

Link copied to clipboard
data class ChartScales(val type: ScalesType? = null, val alignToPixels: Boolean? = null, val backgroundColor: Color? = null, val display: Boolean? = null, val grid: GridLineOptions? = null, val border: BorderOptions? = null, val min: dynamic = null, val max: dynamic = null, val reverse: Boolean? = null, val stacked: Boolean? = null, val suggestedMax: Number? = null, val suggestedMin: Number? = null, val ticks: TickOptions? = null, val weight: Number? = null, val bounds: ScaleBounds? = null, val position: Position? = null, val stack: String? = null, val stackWeight: Number? = null, val axis: String? = null, val offset: Boolean? = null, val title: ScaleTitleOptions? = null, val labels: List<String>? = null, val beginAtZero: Boolean? = null, val grace: dynamic = null, val adapters: dynamic = null, val time: dynamic = null, val animate: Boolean? = null, val angleLines: dynamic = null, val pointLabels: dynamic = null, val startAngle: Number? = null)

Chart scales.

Link copied to clipboard

Chart types.

Link copied to clipboard
data class Configuration(val type: ChartType, val dataSets: List<DataSets>, val labels: List<String>? = null, val options: ChartOptions? = null, val optionsDynamic: dynamic = null, val plugins: List<dynamic>? = null)

Chart configuration.

Link copied to clipboard

Tick cross align modes.

Link copied to clipboard
data class DataSets(val cubicInterpolationMode: InterpolationMode? = null, val backgroundColor: List<Color>? = null, val borderWidth: List<Int>? = null, val borderColor: List<Color>? = null, val borderCapStyle: LineCap? = null, val borderDash: List<Int>? = null, val borderDashOffset: Number? = null, val borderJoinStyle: LineJoin? = null, val borderSkipped: List<Position>? = null, val clip: dynamic = null, val data: List<dynamic>? = null, val fill: dynamic = null, val hoverBackgroundColor: List<Color>? = null, val hoverBorderColor: List<Color>? = null, val hoverBorderWidth: List<Int>? = null, val hoverBorderCapStyle: LineCap? = null, val hoverBorderDash: List<Int>? = null, val hoverBorderDashOffset: Number? = null, val hoverBorderJoinStyle: LineJoin? = null, val indexAxis: String? = null, val label: String? = null, val order: Number? = null, val pointBorderColor: List<Color>? = null, val pointBackgroundColor: List<Color>? = null, val pointBorderWidth: List<Int>? = null, val pointRadius: List<Number>? = null, val pointHoverRadius: List<Number>? = null, val pointHitRadius: List<Number>? = null, val pointHoverBackgroundColor: List<Color>? = null, val pointHoverBorderColor: List<Color>? = null, val pointHoverBorderWidth: List<Int>? = null, val pointRotation: List<Number>? = null, val pointStyle: List<PointStyle>? = null, val segment: dynamic = null, val showLine: Boolean? = null, val spanGaps: Boolean? = null, val stack: String? = null, val stepped: Boolean? = null, val tension: Number? = null, val xAxisID: String? = null, val yAxisID: String? = null, val base: Number? = null, val barPercentage: Number? = null, val barThickness: dynamic = null, val borderRadius: List<Number>? = null, val categoryPercentage: Number? = null, val grouped: Boolean? = null, val hoverBorderRadius: List<Number>? = null, val inflateAmount: List<Number>? = null, val maxBarThickness: Number? = null, val minBarLegth: Number? = null, val skipNull: Boolean? = null, val circumference: Number? = null, val offset: List<Number>? = null, val rotation: Number? = null, val spacing: Number? = null, val weight: Number? = null, val hitRadius: List<Number>? = null, val hoverRadius: List<Number>? = null, val radius: List<dynamic>? = null, val borderAlign: BorderAlign? = null, val cutout: dynamic = null, val animation: dynamic = null, val drawActiveElementsOnTop: Boolean? = null, val circular: Boolean? = null)

Chart data sets.

Link copied to clipboard

Chart animation easings.

Link copied to clipboard
data class ElementsOptions(val point: PointOptions? = null, val line: LineOptions? = null, val arc: ArcOptions? = null, val bar: BarOptions? = null)

Chart elements options.

Link copied to clipboard
data class GridLineOptions(val display: Boolean = true, val color: Color? = null, val lineWidth: Int? = null, val drawOnChartArea: Boolean? = null, val drawTicks: Boolean? = null, val offset: Boolean? = null, val tickLength: Number? = null, val tickWidth: Number? = null, val tickColor: Color? = null, val tickBorderDash: List<Number>? = null, val tickBorderDashOffset: Number? = null, val circular: Boolean? = null, val z: Number? = null)

Chart grid line options.

Link copied to clipboard

Chart interaction modes.

Link copied to clipboard
data class InteractionOptions(val mode: InteractionMode = InteractionMode.NEAREST, val intersect: Boolean = true, val axis: String = "x", val includeInvisible: Boolean = true)

Chart interactions options.

Link copied to clipboard

Chart interpolation modes.

Link copied to clipboard
data class LayoutOptions(val autoPadding: Boolean = true, val padding: LayoutPaddingObject? = null)

Chart layout options.

Link copied to clipboard
data class LayoutPaddingObject(val top: Int? = null, val right: Int? = null, val bottom: Int? = null, val left: Int? = null)

Chart layout padding options.

Link copied to clipboard

Legend align options.

Link copied to clipboard

Legend item align options.

Link copied to clipboard
data class LegendLabelOptions(val boxWidth: Int = 40, val boxHeight: Int? = null, val color: Color? = null, val font: ChartFont? = null, val padding: Int = 10, val generateLabels: (chart: Any) -> Array<LegendItem>? = null, val filter: (legendItem: LegendItem, data: ChartData) -> Boolean? = null, val sort: (a: LegendItem, b: LegendItem, data: ChartData) -> Number? = null, val usePointStyle: Boolean = false, val pointStyle: PointStyle? = null, val textAlign: LegendLabelAlign? = null)

Chart legend label options.

Link copied to clipboard
data class LegendOptions(val display: Boolean = true, val position: Position = Position.TOP, val align: LegendAlign? = null, val maxHeight: Int? = null, val maxWidth: Int? = null, val fullSize: Boolean = true, val reverse: Boolean = false, val labels: LegendLabelOptions? = null, val rtl: Boolean? = null, val textDirection: TextDirection? = null, val title: LegendTitleOptions? = null, val onClick: (event: ChartEvent, legendItem: LegendItem, legend: LegendElement) -> Unit? = null, val onHover: (event: ChartEvent, legendItem: LegendItem, legend: LegendElement) -> Unit? = null, val onLeave: (event: ChartEvent, legendItem: LegendItem, legend: LegendElement) -> Unit? = null)

Chart legend options.

Link copied to clipboard
data class LegendTitleOptions(val display: Boolean? = null, val color: Color? = null, val font: ChartFont? = null, val padding: Int? = null, val text: String? = null)

Chart legend title options.

Link copied to clipboard

Canvas line end point styles.

Link copied to clipboard

Canvas line join styles.

Link copied to clipboard
data class LineOptions(val cubicInterpolationMode: InterpolationMode = InterpolationMode.DEFAULT, val tension: Double? = null, val backgroundColor: Color? = null, val borderWidth: Int? = null, val borderColor: Color? = null, val borderCapStyle: LineCap? = null, val borderDash: List<Any>? = null, val borderDashOffset: Number? = null, val borderJoinStyle: LineJoin? = null, val capBezierPoints: Boolean? = null, val fill: Boolean? = null, val stepped: Boolean? = null)

Chart line options.

Link copied to clipboard
data class PluginsOptions(val legend: LegendOptions? = null, val title: TitleOptions? = null, val subtitle: TitleOptions? = null, val tooltip: TooltipOptions? = null)

Built-in plugins options.

Link copied to clipboard
data class PointOptions(val radius: Int = 3, val pointStyle: PointStyle = PointStyle.CIRCLE, val backgroundColor: Color? = null, val borderWidth: Int = 1, val borderColor: Color? = null, val hitRadius: Int = 1, val hoverRadius: Int = 4, val hoverBorderWidth: Int = 1)

Chart point options.

Link copied to clipboard

Chart point styles.

Link copied to clipboard

Chart objects positions.

Link copied to clipboard

Scales bounds modes.

Link copied to clipboard

Chart scales.

Link copied to clipboard
data class ScaleTitleOptions(val display: Boolean? = null, val color: Color? = null, val font: ChartFont? = null, val padding: LayoutPaddingObject? = null, val align: TitleAlign? = null, val text: String? = null)

Chart scale title options.

Link copied to clipboard

Chart bar border skip modes.

Link copied to clipboard

Legend text direction options.

Link copied to clipboard
data class TickOptions(val callback: (value: Any, index: Any, values: Any) -> dynamic? = null, val display: Boolean = true, val backdropColor: Color? = null, val backdropPadding: LayoutPaddingObject? = null, val color: Color? = null, val font: ChartFont? = null, val major: dynamic = null, val padding: Number? = null, val showLabelBackdrop: Boolean? = null, val textStrokeColor: Color? = null, val textStrokeWidth: Number? = null, val z: Number? = null, val align: TitleAlign? = null, val crossAlign: CrossAlign? = null, val sampleSize: Number? = null, val autoSkip: Boolean? = null, val autoSkipPadding: Number? = null, val includeBounds: Boolean? = null, val labelOffset: Number? = null, val maxRotation: Number? = null, val minRotation: Number? = null, val mirror: Boolean? = null, val count: Number? = null, val format: dynamic = null, val maxTicksLimit: Int? = null, val precision: Number? = null, val stepSize: Number? = null, val source: dynamic = null)

Chart tick options.

Link copied to clipboard

Title align options.

Link copied to clipboard
data class TitleOptions(val align: TitleAlign? = null, val display: Boolean = false, val position: Position = Position.TOP, val color: Color? = null, val font: ChartFont? = null, val padding: Int = 10, val fullSize: Boolean? = null, val text: List<String>? = null)

Chart title options.

Link copied to clipboard

Title and body align options.

Link copied to clipboard
data class TooltipCallback(val beforeTitle: (item: Array<TooltipItem>) -> dynamic? = null, val title: (item: Array<TooltipItem>) -> dynamic? = null, val afterTitle: (item: Array<TooltipItem>) -> dynamic? = null, val beforeBody: (item: Array<TooltipItem>) -> dynamic? = null, val beforeLabel: (tooltipItem: TooltipItem) -> dynamic? = null, val label: (tooltipItem: TooltipItem) -> dynamic? = null, val labelColor: (tooltipItem: TooltipItem, chart: Chart) -> TooltipLabelStyle? = null, val labelTextColor: (tooltipItem: TooltipItem, chart: Chart) -> String? = null, val afterLabel: (tooltipItem: TooltipItem) -> dynamic? = null, val afterBody: (item: Array<TooltipItem>) -> dynamic? = null, val beforeFooter: (item: Array<TooltipItem>) -> dynamic? = null, val footer: (item: Array<TooltipItem>) -> dynamic? = null, val afterFooter: (item: Array<TooltipItem>) -> dynamic? = null)

Chart tooltips callbacks.

Link copied to clipboard
data class TooltipOptions(val enabled: Boolean = true, val external: (ctx: TooltipContext) -> Unit? = null, val mode: InteractionMode? = null, val intersect: Boolean? = null, val position: TooltipPosition? = null, val callbacks: TooltipCallback? = null, val filter: (e: TooltipItem, index: Number, array: Array<TooltipItem>, data: ChartData) -> Boolean? = null, val itemSort: (a: TooltipItem, b: TooltipItem, data: ChartData) -> Number? = null, val backgroundColor: Color? = null, val titleColor: Color? = null, val titleFont: ChartFont? = null, val titleAlign: TooltipAlign? = null, val titleSpacing: Int? = null, val titleMarginBottom: Int? = null, val bodyColor: Color? = null, val bodyFont: ChartFont? = null, val bodyAlign: TooltipAlign? = null, val bodySpacing: Int? = null, val footerColor: Color? = null, val footerFont: ChartFont? = null, val footerAlign: TooltipAlign? = null, val footerSpacing: Int? = null, val footerMarginTop: Int? = null, val padding: LayoutPaddingObject? = null, val caretPadding: Int? = null, val caretSize: Int? = null, val cornerRadius: Int? = null, val multiKeyBackground: Color? = null, val displayColors: Boolean? = null, val boxWidth: Int? = null, val boxHeight: Int? = null, val boxPadding: Number? = null, val usePointStyle: Boolean? = null, val borderColor: Color? = null, val borderWidth: Int? = null, val rtl: Boolean? = null, val textDirection: TextDirection? = null, val xAlign: TooltipAlign? = null, val yAlign: TooltipAlign? = null)

Chart tooltip options.

Link copied to clipboard

Chart tooltip positions.

Link copied to clipboard

Chart update modes.

Functions

Link copied to clipboard
fun Container.chart(configuration: Configuration, chartWidth: Int? = null, chartHeight: Int? = null, className: String? = null, init: Chart.() -> Unit? = null): Chart

DSL builder extension function.

Link copied to clipboard
fun AnimationOptions.toJs(): dynamic
fun ArcOptions.toJs(): dynamic
fun BarOptions.toJs(): dynamic
fun BorderOptions.toJs(): dynamic
fun ChartFont.toJs(): dynamic
fun ElementsOptions.toJs(): dynamic
fun GridLineOptions.toJs(): dynamic
fun InteractionOptions.toJs(): dynamic
fun LayoutOptions.toJs(): dynamic
fun LayoutPaddingObject.toJs(): dynamic
fun LegendLabelOptions.toJs(): dynamic
fun LineOptions.toJs(): dynamic
fun PointOptions.toJs(): dynamic
fun TickOptions.toJs(): dynamic
fun TooltipCallback.toJs(): dynamic
fun TooltipOptions.toJs(): dynamic
fun ChartOptions.toJs(i18nTranslator: (String) -> String): dynamic
fun ChartScales.toJs(i18nTranslator: (String) -> String): dynamic
fun DataSets.toJs(i18nTranslator: (String) -> String): dynamic
fun LegendOptions.toJs(i18nTranslator: (String) -> String): dynamic
fun LegendTitleOptions.toJs(i18nTranslator: (String) -> String): dynamic
fun PluginsOptions.toJs(i18nTranslator: (String) -> String): dynamic
fun ScaleTitleOptions.toJs(i18nTranslator: (String) -> String): dynamic
fun TitleOptions.toJs(i18nTranslator: (String) -> String): dynamic

An extension function to convert configuration class to JS object.