aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-chart
diff options
context:
space:
mode:
Diffstat (limited to 'kvision-modules/kvision-chart')
-rw-r--r--kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Chart.kt9
-rw-r--r--kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Configuration.kt4
2 files changed, 12 insertions, 1 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 4681d9c4..91658476 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
@@ -23,6 +23,7 @@ package pl.treksoft.kvision.chart
import com.github.snabbdom.VNode
import pl.treksoft.kvision.chart.js.Chart.ChartConfiguration
+import pl.treksoft.kvision.chart.js.Chart as JsChart
import pl.treksoft.kvision.core.Container
import pl.treksoft.kvision.core.Widget
@@ -125,5 +126,13 @@ open class Chart(
this.add(chart)
return chart
}
+
+ fun registerPlugin(plugin: dynamic) {
+ JsChart.plugins.register(plugin)
+ }
+
+ fun unregisterPlugin(plugin: dynamic) {
+ JsChart.plugins.unregister(plugin)
+ }
}
}
diff --git a/kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Configuration.kt b/kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Configuration.kt
index 91944e74..ec69795b 100644
--- a/kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Configuration.kt
+++ b/kvision-modules/kvision-chart/src/main/kotlin/pl/treksoft/kvision/chart/Configuration.kt
@@ -751,7 +751,8 @@ data class ChartOptions(
val spanGaps: Boolean? = null,
val cutoutPercentage: Int? = null,
val circumference: Double? = null,
- val rotation: Double? = null
+ val rotation: Double? = null,
+ val plugins: dynamic = null
)
/**
@@ -783,6 +784,7 @@ fun ChartOptions.toJs(i18nTranslator: (String) -> (String)): dynamic {
if (cutoutPercentage != null) this.cutoutPercentage = cutoutPercentage
if (circumference != null) this.circumference = circumference
if (rotation != null) this.rotation = rotation
+ if (plugins != null) this.plugins = plugins
}
}