Most of the chart classes do not have secondary constructors. This prevents use
of the hierarchical building pattern. For instance, when creating BarChart we
currently have to address properties through a variable holding the chart:
val barChart1 = BarChart(new CategoryAxis(), new NumberAxis())
barChart1.title = "Speculations"
barChart1.data = createChartData(data1)
barChart1.legendVisible = false
barChart1.onMouseClicked = showInTable(barChart1.title(), data1)
With a secondary constructor taking axis as arguments (corresponding to similar
delegate constructor) we could use hierarchical building pattern:
val barChart1 = new BarChart(new CategoryAxis(), new NumberAxis()) {
title = "Speculations"
data = createChartData(data1)
legendVisible = false
onMouseClicked = showInTable(title(), data1)
}
Secondary constructors, corresponding to delegate constructors, should be added
for all chart classes.
Original issue reported on code.google.com by jpsacha on 9 Aug 2013 at 12:10
Original issue reported on code.google.com by
jpsacha
on 9 Aug 2013 at 12:10