kvision / pl.treksoft.kvision.chart / ChartOptions

ChartOptions

data class ChartOptions

Chart options.

Constructors

<init>

ChartOptions(responsive: Boolean = true, responsiveAnimationDuration: Int = 0, aspectRatio: Int = 2, maintainAspectRatio: Boolean = true, onResize: ((chart: Chart, newSize: Chart.ChartSize) -> Unit)? = null, devicePixelRatio: Int? = null, hover: HoverOptions? = null, events: List<String>? = null, onHover: ((chart: Chart, event: MouseEvent, activeElements: Array<Any>) -> Any)? = null, onClick: ((chart: Chart, event: MouseEvent, activeElements: Array<Any>) -> Any)? = null, animation: AnimationOptions? = null, layout: LayoutOptions? = null, legend: LegendOptions? = null, legendCallback: ((chart: Chart) -> String)? = null, title: TitleOptions? = null, tooltips: TooltipOptions? = null, elements: ElementsOptions? = null, scales: ChartScales? = null, showLines: Boolean? = null, spanGaps: Boolean? = null, cutoutPercentage: Int? = null, circumference: Double? = null, rotation: Double? = null)

Chart options.

Properties

animation

val animation: AnimationOptions?

aspectRatio

val aspectRatio: Int

circumference

val circumference: Double?

cutoutPercentage

val cutoutPercentage: Int?

devicePixelRatio

val devicePixelRatio: Int?

elements

val elements: ElementsOptions?

events

val events: List<String>?

hover

val hover: HoverOptions?

layout

val layout: LayoutOptions?

legend

val legend: LegendOptions?

legendCallback

val legendCallback: ((chart: Chart) -> String)?

maintainAspectRatio

val maintainAspectRatio: Boolean

onClick

val onClick: ((chart: Chart, event: MouseEvent, activeElements: Array<Any>) -> Any)?

onHover

val onHover: ((chart: Chart, event: MouseEvent, activeElements: Array<Any>) -> Any)?

onResize

val onResize: ((chart: Chart, newSize: Chart.ChartSize) -> Unit)?

responsive

val responsive: Boolean

responsiveAnimationDuration

val responsiveAnimationDuration: Int

rotation

val rotation: Double?

scales

val scales: ChartScales?

showLines

val showLines: Boolean?

spanGaps

val spanGaps: Boolean?

title

val title: TitleOptions?

tooltips

val tooltips: TooltipOptions?

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.

toJs

fun ChartOptions.toJs(i18nTranslator: (String) -> String): dynamic

An extension function to convert configuration class to JS object.