tilesfx icon indicating copy to clipboard operation
tilesfx copied to clipboard

Dates on the X axis?

Open dkoding opened this issue 7 years ago • 0 comments

I am trying to create a chart showing a number per date.

private List<XYChart.Series<String, Number>> datapointItems = new ArrayList<>();
for (String id : t.getIds()) {
                XYChart.Series<String, Number> datapoints = new XYChart.Series<>();
                datapoints.setName(id);
                t.getSeriesFor(id).forEach((key, value) -> datapoints.getData().add(new XYChart.Data<>(formatter.format(key), value)));
                datapointItems.add(datapoints);
            }

    TileBuilder.create()
                                .skinType(Tile.SkinType.SMOOTHED_CHART)
                                .chartType(Tile.ChartType.LINE)
                                .prefSize(800, 600)
                                .title(chartTitle)
                                .series(datapointItems)
                                .build()

As there is no support for date axis I use the String/Category axis. But the same date turn up multiple times on the X axis, and all X-axis values for series 1 are sorted before all X-axis values for series 2. How can I create a date chart with multiple series?

dkoding avatar Nov 28 '18 14:11 dkoding