This repository was archived by the owner on Sep 28, 2024. It is now read-only.

Description
Is there a reason why only the piechart builder has a data parameter?
|
/** |
|
* Create a PieChart with optional title data and add to the parent pane. The optional op will be performed on the new instance. |
|
*/ |
|
fun EventTarget.piechart(title: String? = null, data: ObservableList<PieChart.Data>? = null, op: PieChart.() -> Unit = {}): PieChart { |
|
val chart = if (data != null) PieChart(data) else PieChart() |
|
chart.title = title |
|
return opcr(this, chart, op) |
|
} |
|
/** |
|
* Create a LineChart with optional title, axis and add to the parent pane. The optional op will be performed on the new instance. |
|
*/ |
|
fun <X, Y> EventTarget.linechart(title: String? = null, x: Axis<X>, y: Axis<Y>, op: LineChart<X, Y>.() -> Unit = {}) = |
|
LineChart<X, Y>(x, y).attachTo(this, op) { it.title = title } |