Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dates on the X axis? #64

Open
dkoding opened this issue Nov 28, 2018 · 0 comments
Open

Dates on the X axis? #64

dkoding opened this issue Nov 28, 2018 · 0 comments

Comments

@dkoding
Copy link

dkoding commented Nov 28, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant