Views
2 weeks ago

tornadofx-guide

8. Charts The backing

8. Charts The backing data structure is not much different than a BarChart , and you use the series() and data() functions in the same manner. You can also use a variant of LineChart called AreaChart , which will shade the area under the lines a distinct color, as well as any overlaps (Figure 8.4). Figure 8.4 126

8. Charts Multiseries You can streamline the declaration of more than one series using the multiseries() function, and call the data() functions with varargs values. We can consolidate our previous example using this construct: linechart("Unit Sales Q2 2016", CategoryAxis(), NumberAxis()) { } multiseries("Product X", "Product Y") { data("MAR", 10245, 28443) data("APR", 23963, 22845) data("MAY", 15038, 19045) } This is just another convenience to reduce boilerplate and quickly declare your data structure for a chart. 127

GUIDE
GUIDE
Guide
Guide
Guide
GUIDE
GUIDE
Guide
GUIDE
GUIDE
GUIDE
GUIDE
GUIDE
Guide