Skip to content

Instantly share code, notes, and snippets.

Created April 6, 2021 18:35
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import org.dashbuilder.dataset.*
import org.dashbuilder.displayer.DisplayerSettings;
import org.dashbuilder.dsl.factory.component.ComponentFactory;
import org.dashbuilder.dsl.factory.dashboard.DashboardFactory;
import org.dashbuilder.dsl.model.*
import org.dashbuilder.dsl.serialization.*
import static java.util.Arrays.asList;
import static org.dashbuilder.dataset.DataSetFactory.newDataSetBuilder;
import static org.dashbuilder.displayer.DisplayerSettingsFactory.newBarChartSettings;
import static org.dashbuilder.dsl.factory.navigation.NavigationFactory.*;
import static*;
public class SimpleDashboard {
public static void main(String[] args) {
DataSet dataSet = newDataSetBuilder().column("Country", ColumnType.LABEL)
.column("Population", ColumnType.NUMBER)
.row("Brazil", "211")
.row("United States", "328")
.row("Cuba", "11")
.row("India", "1366")
.row("China", "1398")
DisplayerSettings populationBar = newBarChartSettings().subType_Column()
Page page = page("Countries Population",
row("<h3> Countries Population </h3>"),
Navigation navigation = navigation(group("Countries Information", item(page)));
Dashboard populationDashboard = DashboardFactory.dashboard(asList(page), navigation);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment