Dashboard is a layout component featuring dragdrop based content reordering similar to portal environments. Responsive layout requires PrimeFlex CSS.
<style>
.legacy .ui-panel, .legacy.div.ui-state-hover {
margin: 10px;
}
.legacy .ui-dashboard-column {
width: 220px;
}
.ui-dashboard-active {
border-color: var(- -primary-color);
border-width: 3px !important;
border-style: dashed;
}
.ui-dashboard-hover {
border-color: #C2E085;
border-width: 3px !important;
border-style: solid;
}
body .ui-panel.chart-dashlet .ui-panel-content .ui-chart {
height: 250px;
max-height: 250px;
}
</style>
<h:form id="form">
<p:growl id="msgs" showDetail="true" skipDetailIfEqualsSummary="true">
<p:autoUpdate />
</p:growl>
<div class="card">
<h5 class="mt-0">Responsive</h5>
<p:dashboard id="responsive" model="#{dashboardView.responsiveModel}" responsive="true">
<p:ajax event="reorder" listener="#{dashboardView.handleReorder}" />
<p:panel id="bar" header="Bar" closable="true" styleClass="chart-dashlet" >
<p:ajax event="close" listener="#{dashboardView.handleClose}" />
<f:facet name="options">
<p:menu>
<p:submenu label="Panel Size">
<p:menuitem action="#{dashboardView.onDashboardResize('bar', 'xl:col-4')}" immediate="true" update="@form">
1/3 <p:graphicImage name="demo/images/dashboard/onethird.png" styleClass="ml-2" alt="one third" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('bar', 'xl:col-6')}" immediate="true" update="@form">
1/2 <p:graphicImage name="demo/images/dashboard/onehalf.png" styleClass="ml-2" alt="one half" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('bar', 'xl:col-8')}" immediate="true" update="@form">
2/3 <p:graphicImage name="demo/images/dashboard/twothirds.png" styleClass="ml-2" alt="two thirds" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('bar', 'xl:col-12')}" immediate="true" update="@form">
Full <p:graphicImage name="demo/images/dashboard/full.png" styleClass="ml-2" alt="full" />
</p:menuitem>
</p:submenu>
</p:menu>
</f:facet>
<p:chart value="#{chartView.barModel}" style="width: 100%; height: 100%;" />
</p:panel>
<p:panel id="stacked" header="Stacked" closable="true" styleClass="chart-dashlet" >
<p:ajax event="close" listener="#{dashboardView.handleClose}" />
<f:facet name="options">
<p:menu>
<p:submenu label="Panel Size">
<p:menuitem action="#{dashboardView.onDashboardResize('stacked', 'xl:col-4')}" immediate="true" update="@form">
1/3 <p:graphicImage name="demo/images/dashboard/onethird.png" styleClass="ml-2" alt="one third" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('stacked', 'xl:col-6')}" immediate="true" update="@form">
1/2 <p:graphicImage name="demo/images/dashboard/onehalf.png" styleClass="ml-2" alt="one half" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('stacked', 'xl:col-8')}" immediate="true" update="@form">
2/3 <p:graphicImage name="demo/images/dashboard/twothirds.png" styleClass="ml-2" alt="two thirds" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('stacked', 'xl:col-12')}" immediate="true" update="@form">
Full <p:graphicImage name="demo/images/dashboard/full.png" styleClass="ml-2" alt="full" />
</p:menuitem>
</p:submenu>
</p:menu>
</f:facet>
<p:chart value="#{chartView.stackedBarModel}" style="width: 100%; height: 100%;" />
</p:panel>
<p:panel id="donut" header="Doughnut" closable="true" styleClass="chart-dashlet" >
<p:ajax event="close" listener="#{dashboardView.handleClose}" />
<f:facet name="options">
<p:menu>
<p:submenu label="Panel Size">
<p:menuitem action="#{dashboardView.onDashboardResize('donut', 'xl:col-4')}" immediate="true" update="@form">
1/3 <p:graphicImage name="demo/images/dashboard/onethird.png" styleClass="ml-2" alt="one third" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('donut', 'xl:col-6')}" immediate="true" update="@form">
1/2 <p:graphicImage name="demo/images/dashboard/onehalf.png" styleClass="ml-2" alt="one half" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('donut', 'xl:col-8')}" immediate="true" update="@form">
2/3 <p:graphicImage name="demo/images/dashboard/twothirds.png" styleClass="ml-2" alt="two thirds" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('donut', 'xl:col-12')}" immediate="true" update="@form">
Full <p:graphicImage name="demo/images/dashboard/full.png" styleClass="ml-2" alt="full" />
</p:menuitem>
</p:submenu>
</p:menu>
</f:facet>
<p:chart value="#{chartView.donutModel}" style="width: 100%; height: 100%;" />
</p:panel>
<p:panel id="cartesian" header="Cartesian" closable="true" styleClass="chart-dashlet" >
<p:ajax event="close" listener="#{dashboardView.handleClose}" />
<f:facet name="options">
<p:menu>
<p:submenu label="Panel Size">
<p:menuitem action="#{dashboardView.onDashboardResize('cartesian', 'xl:col-4')}" immediate="true" update="@form">
1/3 <p:graphicImage name="demo/images/dashboard/onethird.png" styleClass="ml-2" alt="one third" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('cartesian', 'xl:col-6')}" immediate="true" update="@form">
1/2 <p:graphicImage name="demo/images/dashboard/onehalf.png" styleClass="ml-2" alt="one half" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('cartesian', 'xl:col-8')}" immediate="true" update="@form">
2/3 <p:graphicImage name="demo/images/dashboard/twothirds.png" styleClass="ml-2" alt="two thirds" />
</p:menuitem>
<p:menuitem action="#{dashboardView.onDashboardResize('cartesian', 'xl:col-12')}" immediate="true" update="@form">
Full <p:graphicImage name="demo/images/dashboard/full.png" styleClass="ml-2" alt="full" />
</p:menuitem>
</p:submenu>
</p:menu>
</f:facet>
<p:chart id="chartline" value="#{chartView.cartesianLinerModel}" style="width: 100%; height: 100%;" />
</p:panel>
</p:dashboard>
</div>
<div class="card">
<h5 class="mt-0">Legacy</h5>
<p:dashboard id="legacy" model="#{dashboardView.legacyModel}" styleClass="legacy">
<p:ajax event="reorder" listener="#{dashboardView.handleReorder}" />
<p:panel id="sports" header="Sports" closable="true" toggleable="true">
<p:ajax event="toggle" listener="#{dashboardView.handleToggle}" />
<p:ajax event="close" listener="#{dashboardView.handleClose}" />
<h:outputText value="Sports Content" />
</p:panel>
<p:panel id="finance" header="Finance" closable="true" toggleable="true">
<p:ajax event="toggle" listener="#{dashboardView.handleToggle}" />
<p:ajax event="close" listener="#{dashboardView.handleClose}" />
<h:outputText value="Finance Content" />
</p:panel>
<p:panel id="lifestyle" header="Lifestyle" closable="true" toggleable="true">
<p:ajax event="toggle" listener="#{dashboardView.handleToggle}" />
<p:ajax event="close" listener="#{dashboardView.handleClose}" />
<h:outputText value="Lifestyle Content" />
</p:panel>
<p:panel id="weather" header="Weather" closable="true" toggleable="true">
<p:ajax event="toggle" listener="#{dashboardView.handleToggle}" />
<p:ajax event="close" listener="#{dashboardView.handleClose}" />
<h:outputText value="Weather Content" />
</p:panel>
<p:panel id="politics" header="Politics" closable="true" toggleable="true">
<p:ajax event="toggle" listener="#{dashboardView.handleToggle}" />
<p:ajax event="close" listener="#{dashboardView.handleClose}" />
<h:outputText value="Politics Content" />
</p:panel>
</p:dashboard>
<div style="clear: both" />
</div>
</h:form>
@Named
@ViewScoped
public class DashboardView implements Serializable {
private static final long serialVersionUID = 1L;
private static final String RESPONSIVE_CLASS = "col-12 lg:col-6 xl:col-6";
private DashboardModel responsiveModel;
private DashboardModel legacyModel;
@PostConstruct
public void init() {
// responsive
responsiveModel = new DefaultDashboardModel();
responsiveModel.addWidget(new DefaultDashboardWidget("bar", RESPONSIVE_CLASS));
responsiveModel.addWidget(new DefaultDashboardWidget("stacked", RESPONSIVE_CLASS));
responsiveModel.addWidget(new DefaultDashboardWidget("donut", RESPONSIVE_CLASS.replaceFirst("xl:col-\\d+", "xl:col-4")));
responsiveModel.addWidget(new DefaultDashboardWidget("cartesian", RESPONSIVE_CLASS.replaceFirst("xl:col-\\d+", "xl:col-8")));
// legacy
legacyModel = new DefaultDashboardModel();
legacyModel.addWidget(new DefaultDashboardWidget(Arrays.asList("sports", "finance")));
legacyModel.addWidget(new DefaultDashboardWidget(Arrays.asList("lifestyle", "weather")));
legacyModel.addWidget(new DefaultDashboardWidget(Arrays.asList("politics")));
}
public void handleReorder(DashboardReorderEvent event) {
FacesMessage message = new FacesMessage();
message.setSeverity(FacesMessage.SEVERITY_INFO);
message.setSummary("Reordered: " + event.getWidgetId());
String result = String.format("Dragged index: %d, Dropped Index: %d, Widget Index: %d",
event.getSenderColumnIndex(), event.getColumnIndex(), event.getItemIndex());
message.setDetail(result);
addMessage(message);
}
public void handleClose(CloseEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_WARN, "Panel Closed",
"Closed panel ID:'" + event.getComponent().getId() + "'");
addMessage(message);
}
public void handleToggle(ToggleEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Panel Toggled",
"Toggle panel ID:'" + event.getComponent().getId() + "' Status:" + event.getVisibility().name());
addMessage(message);
}
/**
* Dashboard panel has been resized.
*
* @param widget the DashboardPanel
* @param size the new size CSS
*/
public void onDashboardResize(final String widget, final String size) {
final DashboardWidget dashboard = responsiveModel.getWidget(widget);
if (dashboard != null) {
final String newCss = dashboard.getStyleClass().replaceFirst("xl:col-\\d+", size);
dashboard.setStyleClass(newCss);
}
}
private void addMessage(FacesMessage message) {
FacesContext.getCurrentInstance().addMessage(null, message);
}
public DashboardModel getLegacyModel() {
return legacyModel;
}
public DashboardModel getResponsiveModel() {
return responsiveModel;
}
}
@Named
@RequestScoped
public class ChartView implements Serializable {
private static final long serialVersionUID = 1L;
private String json;
private String barModel;
private String bubbleModel;
private String cartesianLinerModel;
private String donutModel;
private String lineModel;
private String pieModel;
private String polarAreaModel;
private String radarModel;
private String scatterModel;
private String stackedBarModel;
@PostConstruct
public void init() {
createBarModel();
createBubbleModel();
createCartesianLinerModel();
createDonutModel();
createJsonModel();
createLineModel();
createPieModel();
createPolarAreaModel();
createRadarModel();
createScatterModel();
createStackedBarModel();
}
private void createPieModel() {
pieModel = new PieChart()
.setData(new PieData()
.addDataset(new PieDataset()
.setData(BigDecimal.valueOf(300), BigDecimal.valueOf(50), BigDecimal.valueOf(100))
.setLabel("My First Dataset")
.addBackgroundColors(new Color(255, 99, 132), new Color(54, 162, 235), new Color(255, 205, 86))
)
.setLabels("Red", "Blue", "Yellow"))
.toJson();
}
private void createPolarAreaModel() {
polarAreaModel = new PolarChart()
.setData(new PolarData()
.addDataset(new PolarDataset()
.setData(BigDecimal.valueOf(11),
BigDecimal.valueOf(16),
BigDecimal.valueOf(7),
BigDecimal.valueOf(3),
BigDecimal.valueOf(14))
.setLabel("My First Dataset")
.addBackgroundColors(
new Color(255, 99, 132),
new Color(75, 192, 192),
new Color(255, 205, 86),
new Color(201, 203, 207),
new Color(54, 162, 235)
)
)
.setLabels("Red", "Green", "Yellow", "Grey", "Blue" ))
.toJson();
}
public void createLineModel() {
lineModel = new LineChart()
.setData(new LineData()
.addDataset(new LineDataset()
.setData(65, 59, 80, 81, 56, 55, 40)
.setLabel("My First Dataset")
.setBorderColor(new Color(75, 192, 192))
.setLineTension(0.1f)
.setFill(new Fill<Boolean>(false)))
.setLabels("January", "February", "March", "April", "May", "June", "July"))
.setOptions(new LineOptions()
.setResponsive(true)
.setMaintainAspectRatio(false)
.setPlugins(new Plugins()
.setTitle(new Title()
.setDisplay(true)
.setText("Line Chart Subtitle")))
).toJson();
}
public void createScatterModel() {
scatterModel = new ScatterChart()
.setData(new ScatterData()
.addDataset(new ScatterDataset()
.addData(new ScatterDataPoint(-10, 0))
.addData(new ScatterDataPoint(0, 10))
.addData(new ScatterDataPoint(10, 5))
.addData(new ScatterDataPoint(8, 14))
.addData(new ScatterDataPoint(12, 2))
.addData(new ScatterDataPoint(13, 7))
.addData(new ScatterDataPoint(6, 9))
.setLabel("Red Dataset")
.setBorderColor(new Color(249, 24, 24))
.setShowLine(Boolean.FALSE)
.setFill(new Fill<Boolean>(true)))
)
.setOptions(new LineOptions()
.setResponsive(true)
.setShowLine(Boolean.FALSE)
.setScales(new Scales()
.addScale(Scales.ScaleAxis.X, new LinearScale().setPosition(ScalesPosition.BOTTOM)))
.setPlugins(new Plugins()
.setTitle(new Title()
.setDisplay(true)
.setText("Scatter Chart")))
).toJson();
}
public void createCartesianLinerModel() {
cartesianLinerModel = new LineChart()
.setData(new LineData()
.addDataset(new LineDataset()
.setData(20, 50, 100, 75, 25, 0)
.setLabel("Left Dataset")
.setLineTension(0.5f)
.setYAxisID("left-y-axis")
.setFill(new Fill<Boolean>(true)))
.addDataset(new LineDataset()
.setData(0.1, 0.5, 1.0, 2.0, 1.5, 0)
.setLabel("Right Dataset")
.setLineTension(0.5f)
.setYAxisID("right-y-axis")
.setFill(new Fill<Boolean>(true)))
.setLabels("Jan", "Feb", "Mar", "Apr", "May", "Jun"))
.setOptions(new LineOptions()
.setResponsive(true)
.setMaintainAspectRatio(false)
.setScales(new Scales()
.addScale("left-y-axis", new LinearScale().setPosition(ScalesPosition.LEFT))
.addScale("right-y-axis", new LinearScale().setPosition(ScalesPosition.RIGHT)))
.setPlugins(new Plugins()
.setTitle(new Title()
.setDisplay(true)
.setText("Cartesian Linear Chart")))
).toJson();
}
public void createBarModel() {
barModel = new BarChart()
.setData(new BarData()
.addDataset(new BarDataset()
.setData(65, 59, 80, 81, 56, 55, 40)
.setLabel("My First Dataset")
.setBackgroundColor(new Color(255, 99, 132, 0.2))
.setBorderColor(new Color(255, 99, 132))
.setBorderWidth(1))
.addDataset(new BarDataset()
.setData(85, 69, 20, 51, 76, 75, 10)
.setLabel("My Second Dataset")
.setBackgroundColor(new Color(255, 159, 64, 0.2))
.setBorderColor(new Color(255, 159, 64))
.setBorderWidth(1)
)
.setLabels("January", "February", "March", "April", "May", "June", "July"))
.setOptions(new BarOptions()
.setResponsive(true)
.setMaintainAspectRatio(false)
.setIndexAxis(BarOptions.IndexAxis.X)
.setScales(new Scales().addScale(Scales.ScaleAxis.Y, new BarScale<CategoryTicks>()
.setBarPercentage(BigDecimal.valueOf(0.9))
.setStacked(false)
.setTicks(new CategoryTicks()
.setAutoSkip(true)
.setMirror(true)))
)
.setPlugins(new Plugins()
.setTitle(new Title()
.setDisplay(true)
.setText("Bar Chart using XDEV java model")))
).toJson();
}
public void createStackedBarModel() {
stackedBarModel = new BarChart()
.setData(new BarData()
.addDataset(new BarDataset()
.setData(62, -58, -49, 25, 4, 77, -41)
.setLabel("Dataset 1")
.setBackgroundColor(new Color(255, 99, 132)))
.addDataset(new BarDataset()
.setData(-1, 32, -52, 11, 97, 76, -78)
.setLabel("Dataset 2")
.setBackgroundColor(new Color(54, 162, 235)))
.addDataset(new BarDataset()
.setData(-44, 25, 15, 92, 80, -25, -11)
.setLabel("Dataset 3")
.setBackgroundColor(new Color(75, 192, 192)))
.setLabels("January", "February", "March", "April", "May", "June", "July"))
.setOptions(new BarOptions()
.setResponsive(true)
.setMaintainAspectRatio(false)
.setScales(new Scales()
.addScale(Scales.ScaleAxis.X, new BarScale<CategoryTicks>()
.setStacked(true)
.setTicks(new CategoryTicks()))
.addScale(Scales.ScaleAxis.Y, new BarScale<CategoryTicks>()
.setStacked(true)
.setTicks(new CategoryTicks()))
)
.setPlugins(new Plugins()
.setTooltip(new Tooltip().setMode("index"))
.setTitle(new Title()
.setDisplay(true)
.setText("Bar Chart - Stacked")))
).toJson();
}
public void createRadarModel() {
radarModel = new RadarChart()
.setData(new RadarData()
.addDataset(new RadarDataset()
.setData(BigDecimal.valueOf(2.2),
BigDecimal.valueOf(3),
BigDecimal.valueOf(2.4),
BigDecimal.valueOf(1.1),
BigDecimal.valueOf(3))
.setLabel("P.Practitioner")
.setLineTension(0.1f)
.setBackgroundColor(new Color(102, 153, 204, 0.2))
.setBorderColor(new Color(102, 153, 204, 1))
.setPointBackgroundColor(List.of(new Color(102, 153, 204, 1)))
.setPointBorderColor(List.of(Color.WHITE))
.setPointHoverRadius(List.of(5))
.setPointHoverBackgroundColor(List.of(Color.WHITE))
.setPointHoverBorderColor(List.of(new Color(102, 153, 204, 1))))
.addDataset(new RadarDataset()
.setData(BigDecimal.valueOf(2.1),
BigDecimal.valueOf(3),
BigDecimal.valueOf(3),
BigDecimal.valueOf(2.7),
BigDecimal.valueOf(3))
.setLabel("P.Manager")
.setLineTension(0.1f)
.setBackgroundColor(new Color(255, 204, 102, 0.2))
.setBorderColor(new Color(255, 204, 102, 1))
.setPointBackgroundColor(List.of(new Color(255, 204, 102, 1)))
.setPointBorderColor(List.of(Color.WHITE))
.setPointHoverRadius(List.of(5))
.setPointHoverBackgroundColor(List.of(Color.WHITE))
.setPointHoverBorderColor(List.of(new Color(255, 204, 102, 1))))
.setLabels("Process Excellence", "Problem Solving", "Facilitation", "Project Mgmt", "Change Mgmt"))
.setOptions(new RadarOptions()
.setResponsive(true)
.setMaintainAspectRatio(false)
.setScales(new Scales().addScale(Scales.ScaleAxis.Y, new RadialLinearScale<RadialLinearTicks>()
.setAngleLines(new AngleLines()
.setDisplay(Boolean.TRUE)
.setLineWidth(BigDecimal.valueOf(0.5))
.setColor(new Color(128, 128, 128, 0.2)))
.setPointLabels(new PointLabels()
.setFontSize(BigDecimal.valueOf(14))
.setFontStyle(FontStyle.NORMAL)
.setFontFamily("Lato, sans-serif")
.setFontColor(new Color(204, 204, 204, 1)))
.setTicks(new RadialLinearTicks()
.setBeginAtZero(Boolean.TRUE)
.setDisplay(false)
.setMin(BigDecimal.ZERO)
.setAutoSkip(false)
.setStepSize(BigDecimal.valueOf(0.2))
.setMax(BigDecimal.valueOf(3))))
)
.setPlugins(new Plugins()
.setTitle(new Title()
.setDisplay(true)
.setText("Radar Chart")))
).toJson();
}
public void createBubbleModel() {
bubbleModel = new BubbleChart()
.setData(new BubbleData()
.addDataset(new BubbleDataset()
.addData(new BubbleDataPoint(BigDecimal.valueOf(20), BigDecimal.valueOf(30), BigDecimal.valueOf(15)))
.addData(new BubbleDataPoint(BigDecimal.valueOf(40), BigDecimal.valueOf(10), BigDecimal.valueOf(10)))
.setLabel("My First Dataset")
.setBackgroundColor(new Color(255, 99, 132))
.setBorderColor(new Color(255, 99, 132))
)).toJson();
}
public void createDonutModel() {
donutModel = new DoughnutChart()
.setData(new DoughnutData()
.addDataset(new DoughnutDataset()
.setData(BigDecimal.valueOf(300),
BigDecimal.valueOf(50),
BigDecimal.valueOf(100))
.addBackgroundColors(
new Color(255, 99, 132),
new Color(54, 162, 235),
new Color(255, 205, 86))
)
.setLabels("Red", "Blue", "Yellow"))
.setOptions(new DoughnutOptions().setMaintainAspectRatio(Boolean.FALSE))
.toJson();
}
public void createJsonModel() {
json = "{\r\n"
+ " \"type\":\"line\",\r\n"
+ " \"data\":{\r\n"
+ " \"datasets\":[\r\n"
+ " {\r\n"
+ " \"backgroundColor\":\"rgba(40, 180, 99, 0.3)\",\r\n"
+ " \"borderColor\":\"rgb(40, 180, 99)\",\r\n"
+ " \"borderWidth\":1,\r\n"
+ " \"data\":[\r\n"
+ " {\r\n"
+ " \"x\":1699457269877,\r\n"
+ " \"y\":20\r\n"
+ " },\r\n"
+ " {\r\n"
+ " \"x\":1700047109694,\r\n"
+ " \"y\":20\r\n"
+ " }\r\n"
+ " ],\r\n"
+ " \"hidden\":false,\r\n"
+ " \"label\":\"Device Id: 524967 Register: A - total Wh \",\r\n"
+ " \"minBarLength\":3\r\n"
+ " },\r\n"
+ " {\r\n"
+ " \"backgroundColor\":\"rgba(218, 117, 255, 0.3)\",\r\n"
+ " \"borderColor\":\"rgb(218, 117, 255)\",\r\n"
+ " \"borderWidth\":1,\r\n"
+ " \"data\":[\r\n"
+ " {\r\n"
+ " \"x\":1699457267847,\r\n"
+ " \"y\":10\r\n"
+ " },\r\n"
+ " {\r\n"
+ " \"x\":1700047108397,\r\n"
+ " \"y\":234\r\n"
+ " }\r\n"
+ " ],\r\n"
+ " \"hidden\":false,\r\n"
+ " \"label\":\"Device Id: 524967 Register: A+ total Wh \",\r\n"
+ " \"minBarLength\":3\r\n"
+ " }\r\n"
+ " ]\r\n"
+ " },\r\n"
+ " \"options\":{\r\n"
+ " \"plugins\":{\r\n"
+ " \"legend\":{\r\n"
+ " \"display\":true,\r\n"
+ " \"fullWidth\":true,\r\n"
+ " \"position\":\"top\",\r\n"
+ " \"reverse\":false,\r\n"
+ " \"rtl\":false\r\n"
+ " },\r\n"
+ " \"title\":{\r\n"
+ " \"display\":true,\r\n"
+ " \"text\":\"Values from the meter\"\r\n"
+ " },\r\n"
+ " \"zoom\":{\r\n"
+ " \"pan\":{\r\n"
+ " \"enabled\":true,\r\n"
+ " \"mode\":\"xy\",\r\n"
+ " \"threshold\":5\r\n"
+ " },\r\n"
+ " \"zoom\":{\r\n"
+ " \"wheel\":{\r\n"
+ " \"enabled\":true\r\n"
+ " },\r\n"
+ " \"pinch\":{\r\n"
+ " \"enabled\":true\r\n"
+ " },\r\n"
+ " \"mode\":\"xy\"\r\n"
+ " }\r\n"
+ " }\r\n"
+ " },\r\n"
+ " \"scales\":{\r\n"
+ " \"x\":{\r\n"
+ " \"beginAtZero\":false,\r\n"
+ " \"offset\":true,\r\n"
+ " \"reverse\":false,\r\n"
+ " \"stacked\":true,\r\n"
+ " \"ticks\":{\r\n"
+ " \"autoSkip\":true,\r\n"
+ " \"maxRotation\":0,\r\n"
+ " \"minRotation\":0,\r\n"
+ " \"mirror\":false,\r\n"
+ " \"source\":\"data\"\r\n"
+ " },\r\n"
+ " \"time\":{\r\n"
+ " \"displayFormats\":{\r\n"
+ " \"minute\":\"dd.LL T\"\r\n"
+ " },\r\n"
+ " \"round\":\"minute\",\r\n"
+ " \"stepSize\":\"60\",\r\n"
+ " \"unit\":\"minute\"\r\n"
+ " },\r\n"
+ " \"type\":\"time\"\r\n"
+ " },\r\n"
+ " \"y\":{\r\n"
+ " \"beginAtZero\":false,\r\n"
+ " \"offset\":false,\r\n"
+ " \"reverse\":false,\r\n"
+ " \"stacked\":true,\r\n"
+ " \"ticks\":{\r\n"
+ " \"autoSkip\":true,\r\n"
+ " \"mirror\":false\r\n"
+ " }\r\n"
+ " }\r\n"
+ " },\r\n"
+ " \"showLine\":true,\r\n"
+ " \"spanGaps\":false\r\n"
+ " }\r\n"
+ "}";
}
public void itemSelect(ItemSelectEvent event) {
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Item selected",
"Value: " + event.getData()
+ ", Item Index: " + event.getItemIndex()
+ ", DataSet Index:" + event.getDataSetIndex());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
public String getPieModel() {
return pieModel;
}
public void setPieModel(String pieModel) {
this.pieModel = pieModel;
}
public String getPolarAreaModel() {
return polarAreaModel;
}
public void setPolarAreaModel(String polarAreaModel) {
this.polarAreaModel = polarAreaModel;
}
public String getLineModel() {
return lineModel;
}
public void setLineModel(String lineModel) {
this.lineModel = lineModel;
}
public String getCartesianLinerModel() {
return cartesianLinerModel;
}
public void setCartesianLinerModel(String cartesianLinerModel) {
this.cartesianLinerModel = cartesianLinerModel;
}
public String getBarModel() {
return barModel;
}
public void setBarModel(String barModel) {
this.barModel = barModel;
}
public String getStackedBarModel() {
return stackedBarModel;
}
public void setStackedBarModel(String stackedBarModel) {
this.stackedBarModel = stackedBarModel;
}
public String getRadarModel() {
return radarModel;
}
public void setRadarModel(String radarModel) {
this.radarModel = radarModel;
}
public String getBubbleModel() {
return bubbleModel;
}
public void setBubbleModel(String bubbleModel) {
this.bubbleModel = bubbleModel;
}
public String getDonutModel() {
return donutModel;
}
public void setDonutModel(String donutModel) {
this.donutModel = donutModel;
}
public String getScatterModel() {
return scatterModel;
}
public void setScatterModel(String scatterModel) {
this.scatterModel = scatterModel;
}
public String getJson() {
return json;
}
public void setJson(String json) {
this.json = json;
}
}