Browse Source

Maskenfelder in Makros / Dashboards ermöglichen #7

master
Daniel Quathamer 1 day ago
parent
commit
68be87963e
  1. 1
      src-modules/module/viz/conf/includes.txt
  2. 74
      src-modules/module/viz/conf/viz.xml
  3. 3
      src-modules/module/viz/masken/44190_felderinfo.unl
  4. 2
      src-modules/module/viz/masken/44570_felderinfo.unl
  5. 4
      src-modules/module/viz/masken/44630_felderinfo.unl
  6. 2
      src-modules/module/viz/masken/44630_maskeninfo.unl
  7. 2
      src-modules/module/viz/masken/44660_maskeninfo.unl
  8. 51
      src-modules/module/viz/schluesseltabellen/customxmladd.sql
  9. 84
      src-modules/module/viz/schluesseltabellen/viz_chart.unl
  10. 48
      src-modules/module/viz/schluesseltabellen/viz_type_echarts_fuellen.sql
  11. 0
      src-modules/module/viz/upgrade/viz_upgrade_man.sql
  12. 171
      superx/xml/js/viz/echarts_langDE.js
  13. 20
      superx/xml/js/viz/viz_assistent.js
  14. 35
      superx/xml/js/viz/viz_viewer.js
  15. 42
      superx/xml/viz_components.xsl
  16. 35
      superx/xml/viz_html_chart.xsl

1
src-modules/module/viz/conf/includes.txt

@ -38,6 +38,7 @@ WEB-INF/reports/viz_report_44660_xmlsource.jrxml @@ -38,6 +38,7 @@ WEB-INF/reports/viz_report_44660_xmlsource.jrxml
xml/js/viz/d3.min.js
xml/js/viz/d3-7.8.0-license.txt
xml/js/viz/echarts.min.js
xml/js/viz/echarts_langDE.js
xml/js/viz/echarts-5.6.0-license.txt
xml/js/viz/plot.js
xml/js/viz/plot-0.6.1-license.txt

74
src-modules/module/viz/conf/viz.xml

@ -241,6 +241,80 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" /> @@ -241,6 +241,80 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
<indexes>
</indexes>
</table>
<table name="viz_type_property_group" thema="Administration" typ="Schlüsseltabelle"
releaseUnload="empty">
<description>Schlüsseltabelle für Eigenschaften von Visualisierungstypen</description>
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="viz_type_id" type="INTEGER" size="" default="" notnull="false" description="Diagrammtyp" isKey="true"/>
<column name="viz_property_id" type="INTEGER" size="255" default="" notnull="" description="Eigenschaft der Visualisierung" isKey="true"/>
<column name="viz_property_group_id" type="INTEGER" size="255" default="" notnull="" description="Eigenschaftsgruppe der Visualisierung" isKey="true"/>
<column name="sortnr" type="SMALLINT" size="255" default="0" notnull="false" description="Sortiernr." sortable="true" ><comment></comment></column>
<column name="is_mandatory" type="SMALLINT" size="255" default="0" notnull="false" description="Pflichteingabe" ><comment>1=ja, 0=nein</comment></column>
</columns>
<primaryKeys><rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>viz_type_property_group</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>viz_type_property_group_pk</fld>
</row>
</rs>
</primaryKeys>
<indexes>
</indexes>
</table>
<!--<table name="viz_element" thema="Administration" typ="Schlüsseltabelle"
releaseUnload="empty">
<description>Schlüsseltabelle für Elemente von Visualisierungstypen</description>
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
<column name="uniquename" type="VARCHAR" size="255" default="" notnull="" description="Schlüssel" />
</columns>
<primaryKeys><rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>viz_element</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>viz_element_pk</fld>
</row>
</rs>
</primaryKeys>
<indexes>
</indexes>
</table>
<table name="viz_element_property" thema="Administration" typ="Schlüsseltabelle"
releaseUnload="empty">
<description>Schlüsseltabelle für Eigenschaften von Visualisierungselementen</description>
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="viz_element_id" type="INTEGER" size="" default="" notnull="false" description="Element" isKey="true"/>
<column name="viz_property_id" type="INTEGER" size="255" default="" notnull="" description="Eigenschaft der Visualisierung" isKey="true"/>
<column name="is_mandatory" type="SMALLINT" size="255" default="0" notnull="false" description="Pflichteingabe" ><comment>1=ja, 0=nein</comment></column>
<column name="sortnr" type="SMALLINT" size="255" default="0" notnull="false" description="Sortiernr." sortable="true" ><comment></comment></column>
</columns>
<primaryKeys><rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>viz_type_property</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>viz_type_property_pk</fld>
</row>
</rs>
</primaryKeys>
<indexes>
</indexes>
</table>-->
<table name="viz_property_renderer" thema="Administration" typ="Schlüsseltabelle"
releaseUnload="empty">
<description>Schlüsseltabelle für Renderer von Visualisierungseigenschaften</description>

3
src-modules/module/viz/masken/44190_felderinfo.unl

@ -4,7 +4,8 @@ @@ -4,7 +4,8 @@
44193^Staatsangehörigkeit^36^0^0^130^150^10^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^hidden^^
44194^Status^14^350^-1^140^180^1^sql^30^0^1^<<SQL>> select apnr,eintrag from sos_status order by 2^^<<SQL>> select apnr,eintrag from sos_status where eintrag='Alle ohne Beurl.';^
44195^Hörerstatus^33^0^0^140^170^1^sql^30^0^1^<<SQL>> select apnr, eintrag from hoererstatus order by 2^apnr, eintrag^<<SQL>> select apnr, eintrag from hoererstatus where eintrag='alle';^
44196^Spaltenanzahl^300^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT 1,'1-spaltig' from xdummy \
44196^Spaltenanzahl^300^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT 0,'Automatisch' from xdummy \
union SELECT 1,'1-spaltig' from xdummy \
union SELECT 2,'2-spaltig' from xdummy \
union SELECT 3,'3-spaltig' from xdummy \
union SELECT 4,'4-spaltig' from xdummy \

2
src-modules/module/viz/masken/44570_felderinfo.unl

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
44583^Studiengang^6^0^0^140^150^50^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht', 'SOS-Studiengang-Sicht') order by 3,2;^^^
44584^Jahr^110^0^0^140^80^1^integer^30^0^13^ ^ ^ ^
44585^tablestylesheet^150^0^0^100^100^1^char^255^1^1^<<SQL>> select filename,caption from sx_stylesheets S, sx_mask_style M where S.tid=M.stylesheet_id and M.maskeninfo_id=44570 order by ord^ ^<<SQL>> select filename,caption from sx_stylesheets S, sx_mask_style M where S.tid=M.stylesheet_id and M.maskeninfo_id=44570 order by ord limit 1^
44586^Grafiktitel^1010^0^0^100^100^1^char^255^0^0^ ^ ^ ^
44586^Grafiktitel^1010^0^0^100^100^1^char^255^0^0^ ^{InputCheck:disabled}^ ^
44587^Grafik^1000^300^-1^170^150^1^char^30^0^1^<<SQL>> select uniquename, caption from viz_chart where maskeninfo_id=44570 order by 2;^ ^<<SQL>> select uniquename, caption from viz_chart where maskeninfo_id=44570 order by 2 limit 1;^
44588^Spaltenlayout^3000^350^-1^140^180^1^char^30^1^1^<<SQL>>SELECT uniquename,\
caption\

4
src-modules/module/viz/masken/44630_felderinfo.unl

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
44632^Jahr^110^0^0^140^80^1^integer^30^0^13^ ^ ^ ^
44633^Tabnr.^1000^0^0^140^80^1^integer^30^0^13^ ^^^
44634^Seit Semester^3^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^Eintrag^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^
44635^Filter Studierende^100^0^0^140^150^1^sql^20^0^1^<<SQL>> SELECT id,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SOS_STUD_FILTER' order by 2;^^^
44635^Filter Studierende^100^0^0^140^150^1^sql^20^0^1^<<SQL>> SELECT id,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SOS_STUD_FILTER' order by 2;^hidden^^
44636^bis Fachsemester^1000^300^-1^200^100^1^integer^30^0^0^^ ^ ^
44645^tablestylesheet^150^0^0^100^100^1^char^255^1^1^<<SQL>> select filename,caption from sx_stylesheets S, sx_mask_style M where S.tid=M.stylesheet_id and M.maskeninfo_id in (44190,44660) order by ord^ ^<<SQL>> select filename,caption from sx_stylesheets S, sx_mask_style M where S.tid=M.stylesheet_id and M.maskeninfo_id=44190 order by ord limit 1^
44647^Grafik^1000^300^-1^170^150^1^integer^30^0^1^<<SQL>> select tid, caption from viz_chart order by 2;^hidden^ ^
@ -12,6 +12,6 @@ union SELECT 1,'1-spaltig' from xdummy \ @@ -12,6 +12,6 @@ union SELECT 1,'1-spaltig' from xdummy \
union SELECT 2,'2-spaltig' from xdummy \
union SELECT 3,'3-spaltig' from xdummy \
union SELECT 4,'4-spaltig' from xdummy \
order by 1;^ ^<<SQL>> SELECT 2,'2-spaltig' from xdummy;^
order by 1;^hidden^<<SQL>> SELECT 2,'2-spaltig' from xdummy;^
44650^Kachelbreite^30^0^0^100^100^1^integer^5000^0^0^^^800^
44653^Kachelhöhe^40^0^0^100^100^1^integer^5000^0^0^^^600^

2
src-modules/module/viz/masken/44630_maskeninfo.unl

@ -151,4 +151,4 @@ Column CID=0 heading_text="Zusatzfilter Wert" explanation="" center_heading\ @@ -151,4 +151,4 @@ Column CID=0 heading_text="Zusatzfilter Wert" explanation="" center_heading\
Column CID=0 heading_text="Booklet-Stylesheet" explanation="" center_heading\
row_selectable heading_platform readonly\
width=30\
@@@^ ^ ^Dashboard Inistialisierung^drop table tmp_erg;^^3^700^360^0^1^^
@@@^ ^ ^Das Dashboard zeigt wahlweise Studierende und Studienanfänger*innen nach verschiedenen Merkmalen an.^drop table tmp_erg;^^3^700^360^0^1^Hier erläutern wir die Anzeige^

2
src-modules/module/viz/masken/44660_maskeninfo.unl

@ -1 +1 @@ @@ -1 +1 @@
44660^Campus-Dashboard Übersicht^ ^ ^Altersgruppe^Anzahl^Studienanfänger_innen als Zeitreihe, nach Gesschlecht und Fakultät in verschiedenen Visualisierungen^ ^^3^700^360^0^1^^
44660^Campus-Dashboard Übersicht^ ^ ^Altersgruppe^Anzahl^Studienanfänger_innen als Zeitreihe, nach Geschlecht und Fakultät in verschiedenen Visualisierungen.^ ^^3^700^360^0^1^^

51
src-modules/module/viz/schluesseltabellen/customxmladd.sql

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<#include "MAN_MAKROS"/><sqlvars> <sqlvar name="entries" type="hash">select R.catalogue_id,K.shortname,timeunit,sqlchunk,calcratio,decimalplaces,linksub,linktimeline,R.report_id,R.sortnr, R.sortnr2,R.grouping1,G.caption as group_caption from man_catalogue K,man_catalogue_rpt R left outer join man_grouping G on (G.id=R.grouping1) where K.id=R.catalogue_id and R.active=1 and K.id not in ('Bewerber') order by R.sortnr, R.sortnr2 </sqlvar>
<sqlvar name="commonChartProperties" type="hash">
<sqlvar name="commonChartProperties" type="hashsequence">
SELECT
P.tid,
P.caption,
@ -20,17 +20,29 @@ G.sortnr as group_sortnr, @@ -20,17 +20,29 @@ G.sortnr as group_sortnr,
G.uniquename as group_uniquename,
R.uniquename as renderer_uniquename,
GR.variable_name as group_variable_name,
PR.variable_name,
coalesce((select PR.variable_name from viz_property_renderer PR
where PR.property_id=P.tid
and PR.renderer_id=R.tid),P.prop_uniquename) as variable_name,
P.prop_value_type,
P.is_generic
FROM viz_property_input_type I, viz_property P left outer join viz_property_group G
on (P.property_group_id=G.tid)
left outer join viz_property_group_renderer GR on (GR.property_group_id=G.tid)
left outer join viz_renderer R on (R.tid=GR.renderer_id)
left outer join viz_property_renderer PR on (P.tid=PR.property_id)
where I.tid=P.input_type_id
--and P.is_generic=1
FROM viz_type T,
viz_property_input_type I,
viz_property P,
viz_property_group G,
viz_type_property_group TPG,
viz_renderer R,
viz_property_group_renderer GR,
viz_property_renderer PR
where G.tid=TPG.viz_property_group_id
and T.tid=TPG.viz_type_id
and P.tid=TPG.viz_property_id
and T.renderer_id=R.tid
and I.tid=P.input_type_id
and GR.renderer_id=R.tid
and GR.property_group_id=G.tid
and PR.property_id=P.tid
and PR.renderer_id=R.tid
order by G.sortnr,G.uniquename,P.sortnr,P.caption
;
</sqlvar>
@ -65,7 +77,7 @@ P.prop_default, @@ -65,7 +77,7 @@ P.prop_default,
P.prop_unit,
P.is_generic,
P.static_values,
P.is_mandatory,
--P.is_mandatory,
P.explanation,
P.sortnr,
P.range_from,
@ -73,17 +85,18 @@ P.range_to, @@ -73,17 +85,18 @@ P.range_to,
I.caption as input_type_caption,
I.uniquename as input_type_uniquename,
G.uniquename as viz_property_group_uniquename,
TP.is_mandatory,
TP.sortnr,
TPG.is_mandatory,
TPG.sortnr,
P.prop_value_type,
P.is_generic
FROM viz_type T, viz_type_property TP, viz_property P,
viz_property_input_type I, viz_property_group G
where T.tid=TP.viz_type_id
and P.tid=TP.viz_property_id
and I.tid=P.input_type_id
and G.tid=P.property_group_id
order by 2,TP.sortnr,P.caption
FROM viz_type T, viz_property P,
viz_property_input_type I, viz_property_group G, viz_type_property_group TPG
where I.tid=P.input_type_id
and G.tid=TPG.viz_property_group_id
and T.tid=TPG.viz_type_id
and P.tid=TPG.viz_property_id
--and T.uniquename='echarts_bar_y'
order by 2,TPG.sortnr,P.caption
;
</sqlvar>
<sqlvar name="viz_chart" type="hashsequence">

84
src-modules/module/viz/schluesseltabellen/viz_chart.unl

File diff suppressed because one or more lines are too long

48
src-modules/module/viz/schluesseltabellen/viz_type_echarts_fuellen.sql

@ -145,6 +145,23 @@ @@ -145,6 +145,23 @@
/>
<#assign viz_type_properties_general = [
{ "caption":"Y: Label",
"prop_uniquename":"label_y",
"explanation":"Label Y-Achse",
"prop_default":"",
"prop_unit":"",
"is_generic":"0",
"static_values":"",
"is_mandatory":"0",
"input_type_uniquename":"TEXT",
"property_group_uniquename":"TICKS_LABELS_Y",
"sortnr":"",
"range_from":"",
"range_to":"",
"prop_value_type":"string",
"variable_name":"fill"
}
]
/>
@ -355,13 +372,16 @@ CREATE temp TABLE tmp_viz_property @@ -355,13 +372,16 @@ CREATE temp TABLE tmp_viz_property
input_type_uniquename varchar(255),
property_group_id integer,
property_group_uniquename varchar(255),
property_group_variable_name varchar(255),
explanation text,
sortnr integer,
range_from integer,
range_to integer,
prop_value_type varchar(255) DEFAULT 'string'::character varying,
variable_name varchar(255),
is_general smallint
is_general smallint,
viz_type_id integer //TODO
);
</#macro>
@ -484,6 +504,11 @@ update tmp_viz_property set property_group_id=T.tid @@ -484,6 +504,11 @@ update tmp_viz_property set property_group_id=T.tid
from viz_property_group T
where T.uniquename=tmp_viz_property.property_group_uniquename;
update tmp_viz_property T set property_group_variable_name=P.variable_name
from viz_property_group_renderer P
where P.property_group_id=T.property_group_id
and P.renderer_id=${renderer};
select 'Warnung: Property ohne property_group: ' || prop_uniquename
from tmp_viz_property
where property_group_id is null;
@ -566,4 +591,25 @@ P.tid, @@ -566,4 +591,25 @@ P.tid,
case when P.variable_name !='' then P.variable_name else P.prop_uniquename end
from tmp_viz_property P;
delete from viz_property_group_renderer where
(renderer_id,property_group_id) in (select distinct ${renderer},property_group_id
from tmp_viz_property);
insert into viz_property_group_renderer(
renderer_id,
property_group_id,
variable_name)
select distinct
${renderer},
P.property_group_id,
P.property_group_variable_name
FROM tmp_viz_property P;
insert into
viz_type_property_group(viz_type_id,
viz_property_id,
viz_property_group_id,
sortnr,
is_mandatory)
select P.
</#macro>

0
src-modules/module/viz/conf/viz_upgrade_man.sql → src-modules/module/viz/upgrade/viz_upgrade_man.sql

171
superx/xml/js/viz/echarts_langDE.js

@ -0,0 +1,171 @@ @@ -0,0 +1,171 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* AUTO-GENERATED FILE. DO NOT MODIFY.
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['exports', 'echarts'], factory);
} else if (
typeof exports === 'object' &&
typeof exports.nodeName !== 'string'
) {
// CommonJS
factory(exports, require('echarts/lib/echarts'));
} else {
// Browser globals
factory({}, root.echarts);
}
})(this, function(exports, echarts) {
/**
* Language: German.
*/
var localeObj = {
time: {
month: [
'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
],
monthAbbr: [
'Jan', 'Feb', 'Mrz', 'Apr', 'Mai', 'Jun',
'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'
],
dayOfWeek: [
'Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'
],
dayOfWeekAbbr: [
'So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'
]
},
legend: {
selector: {
all: 'Alle',
inverse: 'Invertiert'
}
},
toolbox: {
brush: {
title: {
rect: 'Box Auswahl',
polygon: 'Lasso Auswahl',
lineX: 'Horizontale Auswahl',
lineY: 'Vertikale Auswahl',
keep: 'Bereich Auswahl',
clear: 'Auswahl zurücksetzen'
}
},
dataView: {
title: 'Daten Ansicht',
lang: ['Daten Ansicht', 'Schließen', 'Aktualisieren']
},
dataZoom: {
title: {
zoom: 'Zoom',
back: 'Zoom zurücksetzen'
}
},
magicType: {
title: {
line: 'Zu Liniendiagramm wechseln',
bar: 'Zu Balkendiagramm wechseln',
stack: 'Stapel',
tiled: 'Kachel'
}
},
restore: {
title: 'Wiederherstellen'
},
saveAsImage: {
title: 'Als Bild speichern',
lang: ['Rechtsklick zum Speichern des Bildes']
}
},
series: {
typeNames: {
pie: 'Tortendiagramm',
bar: 'Balkendiagramm',
line: 'Liniendiagramm',
scatter: 'Streudiagramm',
effectScatter: 'Welligkeits-Streudiagramm',
radar: 'Radar-Karte',
tree: 'Baum',
treemap: 'Baumkarte',
boxplot: 'Boxplot',
candlestick: 'Kerzenständer',
k: 'K Liniendiagramm',
heatmap: 'Heatmap',
map: 'Karte',
parallel: 'Parallele Koordinatenkarte',
lines: 'Liniendiagramm',
graph: 'Beziehungsgrafik',
sankey: 'Sankey-Diagramm',
funnel: 'Trichterdiagramm',
gauge: 'Meßanzeige',
pictorialBar: 'Bildlicher Balken',
themeRiver: 'Thematische Flusskarte',
sunburst: 'Sonnenausbruch',
custom: 'Graficu persunalizatu',
chart: 'Diagramm'
}
},
aria: {
general: {
withTitle: 'Dies ist ein Diagramm über "{title}"',
withoutTitle: 'Dies ist ein Diagramm'
},
series: {
single: {
prefix: '',
withName: ' mit Typ {seriesType} namens {seriesName}.',
withoutName: ' mit Typ {seriesType}.'
},
multiple: {
prefix: '. Es besteht aus {seriesCount} Serienzählung.',
withName: ' Die Serie {seriesId} ist ein {seriesType} welcher {seriesName} darstellt.',
withoutName: ' Die {seriesId}-Reihe ist ein {seriesType}.',
separator: {
middle: '',
end: ''
}
}
},
data: {
allData: 'Die Daten sind wie folgt: ',
partialData: 'Die ersten {displayCnt} Elemente sind: ',
withName: 'die Daten für {name} sind {value}',
withoutName: '{value}',
separator: {
middle: ',',
end: '.'
}
}
}
};
echarts.registerLocale('DE', localeObj);
});

20
superx/xml/js/viz/viz_assistent.js

@ -214,7 +214,10 @@ function updateChartModel() @@ -214,7 +214,10 @@ function updateChartModel()
function renderChart(chartDiv,currentChartModel,datasource,title)
{
if(!datasource)
var datasource=0;
if(!title)
var title=document.getElementById("chartName").value;
/*if(document.getElementById("chartName").value=="")
document.getElementById("chartName").value=vizInitialName;*/
if(currentChartModel.chartElements.length>0 && currentChartModel.chartElements[0])
@ -1456,6 +1459,21 @@ if(numberOfChildNodes>0) @@ -1456,6 +1459,21 @@ if(numberOfChildNodes>0)
}
}
break;
case "echarts":
var myParentNode=myChartDiv.childNodes[0];
var mySvgNode=null;
if(myParentNode && myParentNode.childNodes.length>0)
{
myNode=myParentNode.childNodes[0];
if(myNode.nodeName=="svg")
{
// Extract the data as SVG text string
svg_xml = (new XMLSerializer).serializeToString(myNode);
}
}
break;
default:
document.getElementById("chartSrc").innerHTML="Unbekannter Renderer";
break;

35
superx/xml/js/viz/viz_viewer.js

@ -106,6 +106,7 @@ this.groupVariableName=groupVariableName; @@ -106,6 +106,7 @@ this.groupVariableName=groupVariableName;
function renderEChart(chartCode,chartDiv,ergebniselementOrdnr)
{
/*obsolete*/
// Initialize the echarts instance based on the prepared dom
var myChart = echarts.init(document.getElementById(chartDiv),null, { renderer: 'svg' });
@ -1178,8 +1179,10 @@ function renderEChart2(currentChartModel,chartDiv,ergebniselementOrdnr,chartTitl @@ -1178,8 +1179,10 @@ function renderEChart2(currentChartModel,chartDiv,ergebniselementOrdnr,chartTitl
chartDivElem.removeChild(chartDivElem.firstChild);
}
// Initialize the echarts instance based on the prepared dom
var myChart = echarts.init(chartDivElem,null, { renderer: 'svg' });
if(echarts && chartDivElem!=null)
echarts.dispose(chartDivElem);
//echarts.registerLocale('DE', lang);
var myChart = echarts.init(chartDivElem,null, { renderer: 'svg', locale: 'DE'});
var chartType=currentChartModel.chartElements[0].vizTypeUniquename;
var titleText=chartTitle;
if(chartTitle=="")
@ -1368,7 +1371,10 @@ if(orientation=="x") @@ -1368,7 +1371,10 @@ if(orientation=="x")
},
label: {
show: true
}
},
labelLayout(params) {
return getLabelLayout(params,orientation)
}
}
],
@ -1378,6 +1384,25 @@ return option; @@ -1378,6 +1384,25 @@ return option;
}
/* Labels bei Balkendiagramm je nach Orientierung
- horizontal: rechts neben Balken
- vertikal: zentriert im Balken
*/
function getLabelLayout(params,orientation)
{
if(orientation=="x")
{
return {
x: params.rect.x +params.rect.width+ 30,
y: params.rect.y + params.rect.height / 2,
verticalAlign: 'middle',
align: 'right'
};
}
else
return {verticalAlign: 'middle'};
}
function getEchartOptionsNative(currentChartModel,myDataset)
{
@ -1685,7 +1710,7 @@ function getD3ColorScheme(name,size) @@ -1685,7 +1710,7 @@ function getD3ColorScheme(name,size)
}
}
function vizTabelleComboOderSichtLaden(maskentid,fname, caption,fnameEscaped,zeilenanzahl,feldart) {
function vizTabelleComboOderSichtLaden(maskentid,fname, caption,fnameEscaped,zeilenanzahl,feldart,referrerForm) {
Feldname = fname;
var callurl = '/superx/servlet/SuperXmlMaske';
callurl += "?tid=" + maskentid + "&getJSON_" + getEncoded(Feldname) +
@ -1732,7 +1757,7 @@ function vizTabelleComboOderSichtLaden(maskentid,fname, caption,fnameEscaped,zei @@ -1732,7 +1757,7 @@ function vizTabelleComboOderSichtLaden(maskentid,fname, caption,fnameEscaped,zei
if(feldart==12)
jspPage="maske_sicht_laden.jsp";
var editurl="/superx/edit/kern/"+jspPage+"?tid="+maskentid+ "&Feldname="+getEncoded(fname)+"&previousValue="+currentFieldValue;
editurl +="&zeilenanzahl="+zeilenanzahl+"&params="+params;
editurl +="&zeilenanzahl="+zeilenanzahl+"&referrerForm=Weiterverarbeitung&params="+params;
neu2=window.open(editurl,"_blank","directories=no,location=no,menubar=no,scrollbars=yes,resizable=yes,toolbar=no,width=800,height=660");

42
superx/xml/viz_components.xsl

@ -975,7 +975,6 @@ Stand: <xsl:value-of select="../stand" /></p> @@ -975,7 +975,6 @@ Stand: <xsl:value-of select="../stand" /></p>
</xsl:template>
<xsl:template name="viz_viewer_grid">
<!-- Variableninitialisierung fürs Dashboard:
-->
<xsl:variable name="spalten_anz">
@ -1005,7 +1004,7 @@ Stand: <xsl:value-of select="../stand" /></p> @@ -1005,7 +1004,7 @@ Stand: <xsl:value-of select="../stand" /></p>
<!--Beginn Berichtstitel, Pfad, Knopfleiste-->
<!--<section class="hero-body">
<section class="container">--> <!--Beginn Kartenreihe -->
<!--<div class="columns features is-mobile is-left">-->
<div>
<xsl:choose>
<xsl:when test="$spalten_anz='0'">
@ -1035,6 +1034,7 @@ Stand: <xsl:value-of select="../stand" /></p> @@ -1035,6 +1034,7 @@ Stand: <xsl:value-of select="../stand" /></p>
</div><!-- des grid -->
<!-- der section -->
<!--
</section>
</section>--><!-- des Portals -->
@ -1156,33 +1156,37 @@ Platzhalter @@ -1156,33 +1156,37 @@ Platzhalter
</xsl:template>
<!-- Templates für Maskenfelder in Tabellen: -->
<xsl:template name="renderTableDialogs" >
<div class="card var(--bulma-card-background-color)" style="margin-top:5em;">
<form name="Weiterverarbeitung" method="post" target="_self" charset="UTF-8" action="SuperXmlTabelle">
<div class="card-content">
<input name="navi" type="hidden" value="{/ergebnisse/@showNavigation}" />
<input type="hidden" name="tid">
<xsl:param name="ergebniselementOrdnr" select="0" />
<xsl:param name="stylesheet" select="'tabelle_html_viz.xsl'" />
<xsl:variable name="maskentid">
<xsl:choose>
<xsl:when test="/ergebnisse/@isMakro='true'">
<xsl:attribute name="value"><xsl:value-of select="/ergebnisse/makro/@id" /></xsl:attribute>
<xsl:value-of select="/ergebnisse/makro/@id" />
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="value"><xsl:value-of select="/ergebnisse/ergebnis/maskenname/@id" /></xsl:attribute>
<xsl:value-of select="/ergebnisse/ergebnis/maskenname/@id" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div class="card var(--bulma-card-background-color)" style="margin-top:5em;">
<form name="Weiterverarbeitung" method="post" target="_self" charset="UTF-8" action="SuperXmlTabelle">
<div class="card-content">
<input name="navi" type="hidden" value="{/ergebnisse/@showNavigation}" />
<input type="hidden" name="tid" value="{$maskentid}">
</input>
<input type="hidden" name="UserID"><xsl:attribute name="value"><xsl:value-of select="/ergebnisse/userID" /></xsl:attribute></input>
<input type="hidden" name="reuseresult" value="true"/> <!-- gecachte Ergebnis benutzen-->
<input type="hidden" name="reuseresult" value="false"/> <!-- gecachte Ergebnis benutzen-->
<input type="hidden" name="maxoffset" value=""/> <!--im Normalfall wird Servleteinstellung genutzt - nur Druckversion übergibt Wert-->
<input type="hidden" name="offset">
<xsl:attribute name="value"><xsl:value-of select="/ergebnisse/ergebnis/ergebniselement/sqlerg/@offset" /></xsl:attribute>
</input>
<input type="hidden" name="stylesheet" value="" />
<input type="hidden" name="stylesheet" value="{$stylesheet}" />
<input type="hidden" name="contenttype" value="" />
<!-- MB 5/2011 fuer Export nur sichtbarer Tabellenzeilen nach Excel/PDF -->
<input type="hidden" name="irowno" value="" />
<!-- Start Schleife alle Maskenfelder-->
<xsl:for-each select="/ergebnisse/ergebnis[@ordnr='0']/completefields/feld">
<xsl:for-each select="/ergebnisse/ergebnis[@ordnr=$ergebniselementOrdnr]/completefields/feld">
<xsl:variable name="feldname"><xsl:value-of select="@varname" /></xsl:variable>
<xsl:variable name="feldnameEscaped"><xsl:call-template name="create_varname"><xsl:with-param name="string"><xsl:value-of select="@varname"/></xsl:with-param></xsl:call-template></xsl:variable>
<xsl:variable name="feldart">
@ -1206,7 +1210,7 @@ Platzhalter @@ -1206,7 +1210,7 @@ Platzhalter
<xsl:when test="$feldname='##line##'">
<!-- do nothing-->
</xsl:when>
<xsl:when test="$feldHidden='true' or $feldname='tablestylesheet' or $feldart='0'">
<xsl:when test="$feldHidden='true' or $feldname='tablestylesheet' or $feldart='0' or $feldart='13'">
<!--verstecktesFeld oder Eingabefeld-->
<xsl:text disable-output-escaping="yes"><![CDATA[<input type="hidden" name="]]></xsl:text><xsl:value-of disable-output-escaping="no" select="@varname"/><xsl:text>" value="</xsl:text>
<xsl:value-of disable-output-escaping="no" select="value"/><xsl:text>"</xsl:text>
@ -1215,7 +1219,7 @@ Platzhalter @@ -1215,7 +1219,7 @@ Platzhalter
</xsl:when>
<xsl:when test="$feldart='1' or $feldart='12'">
<xsl:call-template name="tabellenFeldComboOderSicht">
<xsl:with-param name="maskeninfo_id" select="/ergebnisse/ergebnis[@ordnr='0']/maskenname/@id"/>
<xsl:with-param name="maskeninfo_id" select="$maskentid"/>
<xsl:with-param name="Feldname" select="$feldname"/>
<xsl:with-param name="FeldnameEscaped" select="$feldnameEscaped"/>
<xsl:with-param name="feldZeilenanzahl" select="$feldZeilenanzahl"/>
@ -1230,7 +1234,7 @@ Platzhalter @@ -1230,7 +1234,7 @@ Platzhalter
</xsl:for-each>
<div class="field">
<button class="button is-primary is-outlined" type="submit" onclick="document.forms['Weiterverarbeitung'].elements['reuseresult'].value='false';document.forms['Weiterverarbeitung'].elements['stylesheet'].value='tabelle_html_viz.xsl';return true;">
<button class="button is-primary is-outlined" type="submit" onclick="document.forms[0].elements['reuseresult'].value='false';return true;">
Neu laden...
</button>
<!--<input type="submit" class="sx_buttondiv_submit" value="Neu laden..." onclick="document.forms['Weiterverarbeitung'].elements['reuseresult'].value='false';document.forms['Weiterverarbeitung'].elements['stylesheet'].value='tabelle_html_viz.xsl';return true;" />-->
@ -1343,6 +1347,8 @@ Platzhalter @@ -1343,6 +1347,8 @@ Platzhalter
<xsl:value-of select="$feldZeilenanzahl"/>
<xsl:text>,'</xsl:text>
<xsl:value-of select="$feldart"/>
<xsl:text>','</xsl:text>
<xsl:value-of select="'Weiterverarbeitung'"/>
<xsl:text>');</xsl:text>
</xsl:variable>
<div class="field is-grouped">
@ -1620,6 +1626,7 @@ Platzhalter @@ -1620,6 +1626,7 @@ Platzhalter
</xsl:variable>
<xsl:if test="contains($importEcharts,'true')">
<script language="JavaScript" type="text/javascript" src="../xml/js/viz/echarts.min.js"></script>
<script language="JavaScript" type="text/javascript" src="../xml/js/viz/echarts_langDE.js"></script>
</xsl:if>
<xsl:variable name="importD3js">
<xsl:call-template name="isRendererNeeded">
@ -1766,6 +1773,7 @@ Platzhalter @@ -1766,6 +1773,7 @@ Platzhalter
<xsl:value-of select="concat($feldname,'-Stand')"/>
</xsl:attribute>
</input>
<!-- Übergabe Sicht klappt nicht in H1:
<input type="hidden">
<xsl:attribute name="name">
<xsl:value-of select="concat($feldname,'-Sicht')"/>
@ -1777,7 +1785,7 @@ Platzhalter @@ -1777,7 +1785,7 @@ Platzhalter
</xsl:call-template>
</xsl:attribute>
</input>
</input>-->
</xsl:if>
</xsl:for-each>
</form>

35
superx/xml/viz_html_chart.xsl

@ -671,29 +671,28 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:HtmlUtils="de.superx.util @@ -671,29 +671,28 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:HtmlUtils="de.superx.util
<!-- Aufruf/Anzeige Diagramm-Vorschau-->
<div class="field is-grouped">
<div class="label-container">
<label class="label is-required is-small"><strong>Grafikvorschau</strong></label>
<label class="label is-required is-small"><strong>Grafikvorschau</strong><span class="separator">&#160;</span>
<span class="separator">&#160;</span>
<a
onClick="showChartDiv('chartDiv2'); renderChart('chartDiv2',myChartModel);">
<span class="icon">
<img src="../images/icons/more.svg" title="Laden" />
</span>
</a></label>
</div>
<span class="separator">&#160;</span>
<span class="separator">&#160;</span>
<!--<button class="button is-small is-rounded is-white is-outlined"
onClick="createChart('chartDiv2');">
<span class="icon is-small"><i class="../images/more.svg"></i>
<img src="../images/more.svg" title="Laden" />
</span>
</button>-->
<a
onClick="showChartDiv('chartDiv2'); renderChart('chartDiv2',myChartModel);">
<span class="icon">
<img src="../images/icons/more.svg" title="Laden" />
</span>
</a>
</div>
<div id="chartCanvas"> <!--class="section"-->
<!--<div id="chartCanvasHeader"> </div>-->
<div id="chartDiv2"> </div>
<div id="chartDiv2" style="width:800px;height:600px;"> </div>
<!--<div id="chartCanvasFooter"></div>-->
</div>
@ -703,18 +702,18 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:HtmlUtils="de.superx.util @@ -703,18 +702,18 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:HtmlUtils="de.superx.util
<!-- Aufruf/Anzeige SVG-Quellcode-->
<div class="field is-grouped">
<div class="label-container">
<label class="label is-required is-small"><strong>Grafikcode (svg)</strong></label>
</div>
<span class="separator">&#160;</span>
<span class="separator">&#160;</span>
<a
<label class="label is-required is-small"><strong>Grafikcode (svg)</strong>
<span class="separator">&#160;</span>
<a
onClick="showSrcCode(myChartModel.renderer);">
<span class="icon">
<img src="../images/icons/more.svg" title="Laden" />
</span>
</a>
</label>
</div>
</div>
<div id="chartSVGsrcDiv"> <!--class="section">-->

Loading…
Cancel
Save