1

I've got a table with a few rows and I want to pull two of those to display them on a chart. I'm using Vaadin for all of this, implemented within my Java project.

final List<Troskovi> productList = selectProducts.findAll();

I use this to return table rows from the table called Troskovi. Later on I can access the date and values using these methods like so:

    final double plIznos[] = {};
    final Date plDatum[] = {};

    for(int i = 0; i<3; i++){
        plDatum[i] = productList.get(i).getDatum();

        plIznos[i] += productList.get(i).getIznos();
    }

Datum means date and Iznos stands for sum or amount. What I want exactly is to display these results based on month, meaning I want my chart to display total values for each month.

These are for adding two lines with Labes Supply and Demand and the values further on are displayed each as one entry.

    conf.addSeries(new ListSeries("Supply", 32, 13, 45, 60, 80, 74));
    conf.addSeries(new ListSeries("Demand", 29, 11, 50, 63, 65, 61));

So right here I would have to pass the sum of all values for each month. Any ideas on how I'd go about doing that? Or a sample code on how that's done. Thanks in advance.

user1938007
  • 459
  • 1
  • 5
  • 14

0 Answers0