From a767cf9a14934afdbc668bd375148c5e45eab92a Mon Sep 17 00:00:00 2001 From: Steffen Hankiewicz Date: Tue, 21 Nov 2023 11:44:11 +0100 Subject: [PATCH] small improvements because of chartjs integration (instead of jqplot) --- ...ashboard_include_statisticsProcesses.xhtml | 110 +++++------------- .../helper/DashboardHelperProcesses.java | 14 +-- 2 files changed, 37 insertions(+), 87 deletions(-) diff --git a/plugin/GUI/META-INF/resources/uii/plugin_dashboard_include_statisticsProcesses.xhtml b/plugin/GUI/META-INF/resources/uii/plugin_dashboard_include_statisticsProcesses.xhtml index e52fa62..323a797 100644 --- a/plugin/GUI/META-INF/resources/uii/plugin_dashboard_include_statisticsProcesses.xhtml +++ b/plugin/GUI/META-INF/resources/uii/plugin_dashboard_include_statisticsProcesses.xhtml @@ -12,86 +12,40 @@ - - - - -
- -
- -
-
-
- -
+ }; + $.extend(true, this.cfg.config, options); + }; + + +
+ +
+ +
+
+
+ +
\ No newline at end of file diff --git a/plugin/src/de/intranda/digiverso/model/helper/DashboardHelperProcesses.java b/plugin/src/de/intranda/digiverso/model/helper/DashboardHelperProcesses.java index 873c318..c8c98d7 100644 --- a/plugin/src/de/intranda/digiverso/model/helper/DashboardHelperProcesses.java +++ b/plugin/src/de/intranda/digiverso/model/helper/DashboardHelperProcesses.java @@ -21,8 +21,6 @@ public class DashboardHelperProcesses { private XMLConfiguration config; private LineChartModel processesPerMonth = null; - - public DashboardHelperProcesses(XMLConfiguration xmlConfiguration) { config = xmlConfiguration; } @@ -38,7 +36,7 @@ public LineChartModel getProcessesPerMonth() { List rawvalues = ControllingManager.getResultsAsObjectList(sql); for (Object[] objArr : rawvalues) { String projectId = (String) objArr[0]; - if (strProjecIds.length()> 1) { + if (strProjecIds.length() > 1) { strProjecIds += ","; } strProjecIds += projectId; @@ -47,15 +45,13 @@ public LineChartModel getProcessesPerMonth() { strProjecIds += ")"; - List values = new ArrayList<>(); List labels = new ArrayList<>(); - - List list = ProcessManager.runSQL( - "Select year(erstellungsdatum) as year, month(erstellungsdatum) as month, count(*) FROM prozesse WHERE IstTemplate=false AND ProjekteID in " + - strProjecIds + " GROUP BY year, month ORDER BY year desc, month desc LIMIT 24;"); + "Select year(erstellungsdatum) as year, month(erstellungsdatum) as month, count(*) FROM prozesse WHERE IstTemplate=false AND ProjekteID in " + + + strProjecIds + " GROUP BY year, month ORDER BY year desc, month desc LIMIT 24;"); Collections.reverse(list); for (Object obj : list) { Object[] o = (Object[]) obj; @@ -78,7 +74,6 @@ public LineChartModel getProcessesPerMonth() { data.setLabels(labels); - //Options LineChartOptions options = new LineChartOptions(); options.setMaintainAspectRatio(false); @@ -97,6 +92,7 @@ public LineChartModel getProcessesPerMonth() { options.setLegend(legend); processesPerMonth.setOptions(options); processesPerMonth.setData(data); + processesPerMonth.setExtender("chartExtender"); } return this.processesPerMonth; }