This repository was archived by the owner on Sep 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 272
Chart builders with data parameter for all charttypes #1132
Copy link
Copy link
Open
Description
Is there a reason why only the piechart builder has a data parameter?
tornadofx/src/main/java/tornadofx/Charts.kt
Lines 7 to 14 in e63f086
| /** | |
| * 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) | |
| } |
tornadofx/src/main/java/tornadofx/Charts.kt
Lines 33 to 37 in e63f086
| /** | |
| * 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 } |
Metadata
Metadata
Assignees
Labels
No labels