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 } |
Is there a reason why only the
piechartbuilder has adataparameter?tornadofx/src/main/java/tornadofx/Charts.kt
Lines 7 to 14 in e63f086
tornadofx/src/main/java/tornadofx/Charts.kt
Lines 33 to 37 in e63f086