use of com.vaadin.flow.component.charts.model.Node in project flow-components by vaadin.
the class Organization method createSeries.
private NodeSeries createSeries() {
NodeSeries series = new NodeSeries();
series.setName("Acme");
Node acme = new Node("Acme");
Node headOffice = new Node("Head Office");
Node labs = new Node("Labs");
Node coyoteBuilding = new Node("Coyote Building");
Node roadRunnerBuilding = new Node("Road Runner Building");
Node sales = new Node("Sales");
Node marketing = new Node("Marketing");
Node accounting = new Node("Accounting");
Node administration = new Node("Administration");
Node mdsOffice = new Node("MD's Office");
Node josephMiler = new Node("Joseph Miler");
josephMiler.setTitle("Head of Sales");
josephMiler.setLayout(NodeLayout.HANGING);
Node erikPerez = new Node("Erik Perez");
erikPerez.setTitle("Head of Marketing");
erikPerez.setLayout(NodeLayout.HANGING);
Node emilyFox = new Node("Emily Fox");
emilyFox.setTitle("Head of Accounting");
Node ewanHerbert = new Node("Ewan Herbert");
ewanHerbert.setTitle("Head of Admin");
ewanHerbert.setLayout(NodeLayout.HANGING);
Node kateKirby = new Node("Kate Kirby");
Node vaughnWhiting = new Node("Vaughn Whiting");
Node lisaWarner = new Node("Lisa Warner");
Node mollyDodd = new Node("Molly Dodd");
Node natashaKelly = new Node("Natasha Kelly");
Node managingDirector = new Node("Sally Brown", "Sally Brown", "Managing Director");
managingDirector.setColor(new SolidColor("#E4B651"));
series.add(acme, headOffice);
series.add(acme, labs);
series.add(headOffice, coyoteBuilding);
series.add(headOffice, roadRunnerBuilding);
series.add(coyoteBuilding, sales);
series.add(coyoteBuilding, marketing);
series.add(coyoteBuilding, accounting);
series.add(roadRunnerBuilding, administration);
series.add(roadRunnerBuilding, mdsOffice);
series.add(sales, josephMiler);
series.add(marketing, erikPerez);
series.add(accounting, emilyFox);
series.add(administration, ewanHerbert);
series.add(josephMiler, kateKirby);
series.add(josephMiler, vaughnWhiting);
series.add(erikPerez, lisaWarner);
series.add(ewanHerbert, mollyDodd);
series.add(ewanHerbert, natashaKelly);
series.add(mdsOffice, managingDirector);
PlotOptionsOrganization plotOptions = createPlotOptions();
series.setPlotOptions(plotOptions);
return series;
}
use of com.vaadin.flow.component.charts.model.Node in project flow-components by vaadin.
the class HasItemTest method getItemWithNodeSeriesThrowsUnsupportedOperationException.
@Test(expected = UnsupportedOperationException.class)
public void getItemWithNodeSeriesThrowsUnsupportedOperationException() {
Chart chart = new Chart();
Node node1 = new Node("Node1");
Node node2 = new Node("Node2");
NodeSeries series = new NodeSeries();
series.add(node1, node2);
chart.getConfiguration().addSeries(series);
HasItem hasItem = new HasItemTestImpl(chart, 0, 0);
hasItem.getItem();
}
Aggregations