Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
timeline add-on stacked graph
Hi,
how to implement stacked graphs like showed in the online demos of the timeline add-on?
Thank you,
Martin
Martin Dobler: Hi,
how to implement stacked graphs like showed in the online demos of the timeline add-on?
Thank you,
Martin
If you use Visualizations For Vaadin you can create a Column Chart and one of the options that you set is isStacked
Hi,
Unfortunately, the Vaadin Timeline does not at the moment feature stacked graphs.
But since all bar graphs in the Vaadin Timeline are rendered on top of each other you can sort of solve it by creating new data sources from the real ones where you sum the data values up. It isn't a very pretty solution though :(
If you would like to see this feature included in future versions of the Vaadin Timeline please create a feature ticket at http://dev.vaadin.com or http://vaadin.uservoice.com/ and it might get included.
Martin Dobler: Hi,
how to implement stacked graphs like showed in the online demos of the timeline add-on?
Thank you,
Martin
Code for a stacked column chart using the add on
ColumnChart cc = new ColumnChart();
cc.setOption("is3D", true);
cc.setOption("isStacked", true);
cc.addXAxisLabel("Year");
cc.addColumn("Expenses");
cc.addColumn("Sales");
cc.addColumn("Stock");
// Values in double are Expenses, Sales, Stock
cc.add("2004", new double[]{100,200,320});
cc.add("2005", new double[]{75,100, 250});
cc.add("2006", new double[]{32,234, 75});
cc.add("2007", new double[]{25,253,4});
cc.add("2008", new double[]{343,12,260});
cc.setSizeFull();
John Ahlroos: Hi,
Unfortunately, the Vaadin Timeline does not at the moment feature stacked graphs.
But since all bar graphs in the Vaadin Timeline are rendered on top of each other you can sort of solve it by creating new data sources from the real ones where you sum the data values up. It isn't a very pretty solution though :(
If you would like to see this feature included in future versions of the Vaadin Timeline please create a feature ticket at http://dev.vaadin.com or http://vaadin.uservoice.com/ and it might get included.
Thank you for your answers. I will create a request for a new chart type ;-)
Martin
Hi
How to draw the same 3d graph as show in image of previous post