ref 12119:AccountingDashboard - Create a new Accounting Dashboard

https://support.d4science.org/issues/12119

Updated Report support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/accounting-dashboard@169753 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-07-11 18:29:05 +00:00
parent ad8a2ca399
commit 40ca09b548
4 changed files with 25 additions and 12 deletions

View File

@ -80,7 +80,7 @@ public class ReportAreaView extends ViewWithUiHandlers<ReportAreaPresenter>
} else {
reportPanel.clear();
for (int i = 0; i < reportData.getElements().size(); i++) {
Chart chart = new Chart("report_" + i, reportData.getElements().get(i));
Chart chart = new Chart(resources, "report_" + i, reportData.getElements().get(i));
reportPanel.add(chart);
}
}

View File

@ -1,5 +1,6 @@
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.chartjs;
import org.gcube.portlets.user.accountingdashboard.client.resources.AppResources;
import org.gcube.portlets.user.accountingdashboard.shared.data.ReportElementData;
import com.google.gwt.event.logical.shared.AttachEvent;
@ -15,11 +16,19 @@ public class Chart extends HTMLPanel {
private String name;
private ReportElementData reportElementData;
public Chart(String name, ReportElementData reportElementData) {
super("<canvas id=" + name + "></canvas>");
/*
* Wraper Style max-height: 600px; min-height: 300px; height: 550px;
*
* Canvas Style width: 100%; max-width: 80%; min-width: 300px; max-height:
* 100%; min-height: 300px;
*
*
*/
public Chart(AppResources resources, String name, ReportElementData reportElementData) {
super("<canvas id=" + name + " width='100%'></canvas>");
this.name = name;
this.reportElementData = reportElementData;
this.addStyleName(resources.uiDataCss().uiDataChartWrapper());
addAttachHandler(new AttachEvent.Handler() {
@Override
@ -96,14 +105,11 @@ public class Chart extends HTMLPanel {
};
var label = this
.@org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.chartjs.Chart::getLabel()();
var label = this.@org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.chartjs.Chart::getLabel()();
var xAxisLabel = this
.@org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.chartjs.Chart::getXAxisLabel()();
var xAxisLabel = this.@org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.chartjs.Chart::getXAxisLabel()();
var yAxisLabel = this
.@org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.chartjs.Chart::getYAxisLabel()();
var yAxisLabel = this.@org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.chartjs.Chart::getYAxisLabel()();
var ctx = canvas.getContext('2d');
var chart = new Chart(ctx, {

View File

@ -30,7 +30,7 @@ public interface AppResources extends ClientBundle {
String uiDataFiltersFormPanel();
String uiDataFiltersControls();
String uiDataExploreTree();
String uiDataChartWrapper();
String uiDataButtonRefresh();
String uiDataIconRefresh();
@ -62,6 +62,7 @@ public interface AppResources extends ClientBundle {
String uiDataPopupGlass();
String uiDataFormTable();
String uiDataFormPager();
}
@Source("uiData.css")

View File

@ -258,6 +258,12 @@
display: block !important;
}
/* Chart */
.uiDataChartWrapper {
height: 500px !important;
}
/* Monitor Dialog */
.uiDataMonitorPopup {
background-color: white;