Hi,
how to implement stacked graphs like showed in the online demos of the timeline add-on?
Thank you,
Martin
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.
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();
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