diff options
Diffstat (limited to 'kvision-modules/kvision-chart')
-rw-r--r-- | kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Chart.kt | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Chart.kt b/kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Chart.kt index 91658476..29cc80c2 100644 --- a/kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Chart.kt +++ b/kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Chart.kt @@ -110,22 +110,6 @@ open class Chart( } companion object { - /** - * DSL builder extension function. - * - * It takes the same parameters as the constructor of the built component. - */ - fun Container.chart( - configuration: Configuration, - chartWidth: Int? = null, - chartHeight: Int? = null, - classes: Set<String> = setOf(), - init: (Chart.() -> Unit)? = null - ): Chart { - val chart = Chart(configuration, chartWidth, chartHeight, classes).apply { init?.invoke(this) } - this.add(chart) - return chart - } fun registerPlugin(plugin: dynamic) { JsChart.plugins.register(plugin) @@ -136,3 +120,20 @@ open class Chart( } } } + +/** + * DSL builder extension function. + * + * It takes the same parameters as the constructor of the built component. + */ +fun Container.chart( + configuration: Configuration, + chartWidth: Int? = null, + chartHeight: Int? = null, + classes: Set<String> = setOf(), + init: (Chart.() -> Unit)? = null +): Chart { + val chart = Chart(configuration, chartWidth, chartHeight, classes).apply { init?.invoke(this) } + this.add(chart) + return chart +} |