Browse Source

Renderer Variablennamen #5

makro_datasrc
Daniel Quathamer 2 years ago
parent
commit
20986bd900
  1. 143
      src-modules/module/viz/conf/viz.xml
  2. 56
      src-modules/module/viz/schluesseltabellen/sx_repository.unl
  3. 40
      src-modules/module/viz/schluesseltabellen/viz_property.unl
  4. 10
      src-modules/module/viz/schluesseltabellen/viz_property_group.unl
  5. 2
      src-modules/module/viz/schluesseltabellen/viz_property_group_renderer.unl
  6. 3
      src-modules/module/viz/schluesseltabellen/viz_property_input_type.unl
  7. 6
      src-modules/module/viz/schluesseltabellen/viz_property_renderer.unl
  8. 6
      src-modules/module/viz/schluesseltabellen/viz_property_unload.x
  9. 6
      src-modules/module/viz/schluesseltabellen/viz_property_upload.x
  10. 2
      src-modules/module/viz/schluesseltabellen/viz_renderer.unl
  11. 6
      superx/style/sx_viz_muster.css
  12. 197
      superx/xml/js/viz/viz_functions.js
  13. 49
      superx/xml/viz_html_chart.xsl

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

@ -63,6 +63,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" /> @@ -63,6 +63,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="uniquename" type="VARCHAR" size="255" default="" notnull="true" description="Unique Name" />
<column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
<column name="sortnr" type="INTEGER" size="255" default="" sortable="true" notnull="" description="Sortiernummer" />
</columns>
<primaryKeys><rs>
<row>
@ -163,11 +164,14 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" /> @@ -163,11 +164,14 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
<column name="prop_default" type="VARCHAR" size="255" default="" notnull="false" description="Defaultwert" />
<column name="prop_unit" type="VARCHAR" size="255" default="" notnull="false" description="Einheit" />
<column name="is_generic" type="SMALLINT" size="255" default="1" notnull="false" description="Generische Eigenschaft" ><comment>1=ja, 0=nein</comment></column>
<column name="static_values" type="TEXT" size="255" default="" notnull="false" description="Wertebereich (statisch)" ><comment>Mit "|" getrennt</comment></column>
<column name="static_values" type="TEXT" size="255" default="" notnull="false" description="Wertebereich (statisch)" ><comment>wird nur bei SELECT-Feldern genutzt, mit "|" getrennt</comment></column>
<column name="is_mandatory" type="SMALLINT" size="255" default="0" notnull="false" description="Pflichteingabe" ><comment>1=ja, 0=nein</comment></column>
<column name="input_type_id" type="INTEGER" size="255" default="1" notnull="false" description="Eingabedialog" ><comment></comment></column>
<column name="property_group_id" type="INTEGER" size="255" default="" notnull="false" description="Art der Eigenschaft" ><comment></comment></column>
<column name="explanation" type="TEXT" size="32255" default="" notnull="false" description="Erläuterung" ><comment>Wird als Tooltip angezeigt</comment></column>
<column name="sortnr" type="INTEGER" size="255" default="" notnull="" description="Sortiernummer" />
<column name="range_from" type="INTEGER" size="255" default="" notnull="" description="Minimalwert" ><comment>Wir nur bei Schiebereglern genutzt</comment></column>
<column name="range_to" type="INTEGER" size="255" default="" notnull="" description="Maximalwert" ><comment>Wir nur bei Schiebereglern genutzt</comment></column>
@ -209,6 +213,54 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" /> @@ -209,6 +213,54 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
<indexes>
</indexes>
</table>
<table name="viz_property_renderer" thema="Administration" typ="Schlüsseltabelle"
releaseUnload="empty">
<description>Schlüsseltabelle für Renderer von Visualisierungseigenschaften</description>
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="renderer_id" type="INTEGER" size="" default="" notnull="true" description="Renderer" isKey="true"/>
<column name="property_id" type="INTEGER" size="255" default="" notnull="true" description="Eigenschaft der Visualisierung" isKey="true" />
<column name="variable_name" type="VARCHAR" size="255" default="" notnull="" description="Variablenname" />
</columns>
<primaryKeys><rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>viz_property_renderer</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>viz_property_renderer_pk</fld>
</row>
</rs>
</primaryKeys>
<indexes>
</indexes>
</table>
<table name="viz_property_group_renderer" thema="Administration" typ="Schlüsseltabelle"
releaseUnload="empty">
<description>Schlüsseltabelle für Renderer von Gruppen von Visualisierungseigenschaften</description>
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="renderer_id" type="INTEGER" size="" default="" notnull="true" description="Renderer" isKey="true"/>
<column name="property_group_id" type="INTEGER" size="255" default="" notnull="true" description="Gruppe der Visualisierung" isKey="true"/>
<column name="variable_name" type="VARCHAR" size="255" default="" notnull="" description="Variablenname" />
</columns>
<primaryKeys><rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>viz_property_group_renderer</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>viz_property_group_renderer_pk</fld>
</row>
</rs>
</primaryKeys>
<indexes>
</indexes>
</table>
<views>
</views>
@ -264,6 +316,24 @@ parent="Masken verwalten">Abfragen zur Administration von Visualisierungen </the @@ -264,6 +316,24 @@ parent="Masken verwalten">Abfragen zur Administration von Visualisierungen </the
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="property_group_id" />
</relation>
<!--viz_property_group_renderer-->
<relation from="viz_property_group" to="viz_property_group_renderer" delete="FALSE"
displayType="select" visibleFields="variable_name" format="%s">
<relation-column from="tid" to="property_group_id" />
</relation>
<relation from="viz_renderer" to="viz_property_group_renderer" delete="FALSE"
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="renderer_id" />
</relation>
<!--viz_property_renderer-->
<relation from="viz_property" to="viz_property_renderer" delete="FALSE"
displayType="select" visibleFields="variable_name" format="%s">
<relation-column from="tid" to="property_id" />
</relation>
<relation from="viz_renderer" to="viz_property_renderer" delete="FALSE"
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="renderer_id" />
</relation>
</data-integrity>
@ -381,7 +451,7 @@ mode="full"> @@ -381,7 +451,7 @@ mode="full">
path="/edit/viz/viz_property_list.jsp"
followUp=""
caption="Diagrammeigenschaften verwalten"
orderBy="name"
orderBy="caption"
gotoHt=""
helpfile=""
maxRows="*"
@ -393,7 +463,8 @@ mode="full"> @@ -393,7 +463,8 @@ mode="full">
<customfield name="tid" nullFieldValue="" />
<customfield name="property_group_id" visibleSize="10" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
<customfield name="prop_uniquename" nullFieldValue="" visibleSize="30" />
<customfield name="sortnr" nullFieldValue="" visibleSize="5" />
<customfield type="link" name="Details" path="/superx/edit/viz/viz_property_edit.jsp" linkid="tid"/>
</form>
<form name="viz_property_edit"
@ -421,16 +492,28 @@ mode="full"> @@ -421,16 +492,28 @@ mode="full">
<customfield name="is_mandatory" visibleSize="10" nullFieldValue="" />
<customfield name="input_type_id" visibleSize="10" nullFieldValue="" />
<customfield name="static_values" visibleSize="80" nullFieldValue="" />
<customfield name="range_from" visibleSize="80" nullFieldValue="" />
<customfield name="range_to" visibleSize="80" nullFieldValue="" />
<customfield name="property_group_id" visibleSize="10" nullFieldValue="" />
<customfield name="explanation" visibleSize="80" nullFieldValue="" />
<customfield name="sortnr" nullFieldValue="" visibleSize="5" />
<customfield name="Renderer" type="subform" multipart="false" autoUpdate="false"
maxRows="*" table="viz_property_renderer" parentField="tid" childField="property_id"
orderBy="variable_name" allowNew="true"
mode="full">
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="property_id" type="hidden" overrideValue="tid" />
<customfield name="renderer_id" nullFieldValue="" visibleSize="30" />
<customfield name="variable_name" visibleSize="50" nullFieldValue="" />
</customfield>
</form>
<form name="viz_property_group_list"
table="viz_property_group"
path="/edit/viz/viz_property_group_list.jsp"
followUp=""
caption="Diagrammgruppen-Eigenschaften verwalten"
orderBy="name"
orderBy="sortnr"
gotoHt=""
helpfile=""
maxRows="*"
@ -442,7 +525,57 @@ mode="full"> @@ -442,7 +525,57 @@ mode="full">
<customfield name="tid" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
<customfield name="sortnr" nullFieldValue="" visibleSize="5" />
<customfield type="link" name="Details" path="/superx/edit/viz/viz_property_group_edit.jsp" linkid="tid"/>
</form>
<form name="viz_property_group_edit"
table="viz_property_group"
path="/edit/viz/viz_property_group_edit.jsp"
followUp=""
caption="Diagrammgruppen-Eigenschaften verwalten"
orderBy="name"
gotoHt=""
helpfile=""
maxRows="1"
mode="full">
<description>In diesem Formular können Sie Gruppen von Diagrammeigenschaften verwalten. </description>
<filters>
</filters>
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
<customfield name="sortnr" nullFieldValue="" visibleSize="5" />
<customfield name="Renderer" type="subform" multipart="false" autoUpdate="false"
maxRows="*" table="viz_property_group_renderer" parentField="tid" childField="property_group_id"
orderBy="variable_name" allowNew="true"
mode="full">
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="property_group_id" type="hidden" overrideValue="tid" />
<customfield name="renderer_id" nullFieldValue="" visibleSize="30" />
<customfield name="variable_name" visibleSize="50" nullFieldValue="" />
</customfield>
</form>
<form name="viz_renderer_list"
table="viz_renderer"
path="/edit/viz/viz_renderer_list.jsp"
followUp=""
caption="Diagramm-Renderer verwalten"
orderBy="caption"
gotoHt=""
helpfile=""
maxRows="*"
mode="full">
<description>In diesem Formular können Sie Diagramm-Renderer verwalten. </description>
<filters>
</filters>
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
</form>
</dbforms>
</module>

56
src-modules/module/viz/schluesseltabellen/sx_repository.unl

@ -1,22 +1,56 @@ @@ -1,22 +1,56 @@
1^CUSTOMXMLADD^<sqlvars> <sqlvar name="commonChartProperties" type="hash">\
SELECT tid,\
caption,\
prop_uniquename,\
prop_default,\
prop_unit\
\
FROM viz_property \
where is_generic=1\
\
SELECT \
P.tid,\
P.caption,\
P.prop_uniquename,\
P.prop_default,\
P.prop_unit,\
P.is_generic,\
P.static_values,\
P.is_mandatory,\
P.explanation,\
P.sortnr,\
P.range_from,\
P.range_to,\
T.caption as input_type_caption,\
T.uniquename as input_type_uniquename,\
G.caption as group_caption,\
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 \
\
FROM viz_property_input_type T, 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_property_renderer PR on (P.tid=PR.property_id)\
left outer join viz_renderer R on (R.tid=PR.renderer_id)\
where T.tid=P.input_type_id\
and P.is_generic=1\
order by G.sortnr,G.uniquename,P.sortnr,P.caption\
;\
</sqlvar> </sqlvars>\
<chartProperties>\
<#if commonChartProperties?is_sequence><#foreach cp in commonChartProperties>\
<\if commonChartProperties?is_sequence><\foreach cp in commonChartProperties>\
<commonChartProperty tid="${cp.tid}" \
caption="${cp.caption}" \
prop_uniquename="${cp.prop_uniquename}" \
prop_default="${cp.prop_default}" \
static_values="${cp.static_values}" \
input_type_uniquename="${cp.input_type_uniquename}" \
group_caption="${cp.group_caption}" \
group_uniquename="${cp.group_uniquename}" \
prop_unit="${cp.prop_unit}" \
prop_range_from="${cp.range_from}" \
prop_range_to="${cp.range_to}" \
renderer_uniquename="${cp.renderer_uniquename}" \
group_variable_name="${cp.group_variable_name}" \
variable_name="${cp.variable_name}" \
\
\
/>\
</#foreach>\
</#if>\
</\foreach>\
</\if>\
</chartProperties>^Chart-Eigenschaften^Hier werden Chart-Eigenschaften gefiltert^^VIZ_PROPERTIES^^^320^1^0^0^^1^01.01.1900^31.12.3000^

40
src-modules/module/viz/schluesseltabellen/viz_property.unl

@ -1,10 +1,30 @@ @@ -1,10 +1,30 @@
1^Höhe^height^500^px^1^^0^1^1^^
3^Werte-Label Breite^valueLabelWidth^20^px^1^^0^1^4^^
8^Füllfarbe^fill^blue^ ^1^ ^0^1^3^^
9^Grid-Label Höhe^gridLabelHeight^18^ ^1^ ^0^1^4^^
10^Grid Offset^gridChartOffset^3^ ^1^ ^0^1^4^^
2^Breite^chartWidth^600^px^1^^0^1^1^^
7^Schriftfamilie^fontFamily^sans-serif^ ^1^sans-serif|serif|monospace^0^2^4^^
6^Schriftgröße^fontSize^10^pt^1^^0^1^4^Text- und Diagrammelemente^
4^Hintergrundfarbe^background-color^#ffffeb^ ^1^^0^1^4^^
5^Vordergrundfarbe^color^#3333ff^ ^1^^0^1^4^Text- und Diagrammelemente^
1^Diagramm-Höhe^height^500^px^1^^0^1^10^(Wird nur ausgewertet wenn es keine Y-Achse gibt)^^^^
2^Diagramm-Breite^chartWidth^600^px^1^^0^1^10^Äußere Breite des Diagramms inkl. Ränder^^100^2000^
3^Werte-Label-Breite^valueLabelWidth^20^px^1^^0^1^10^^^^^
4^Hintergrundfarbe^backgroundColor^#ffffeb^ ^1^ ^0^1^11^^^^^
5^Vordergrundfarbe^color^#3333ff^ ^1^ ^0^1^11^Text- und Diagrammelemente^^^^
6^Schriftgröße^fontSize^10^pt^1^^0^1^11^Text- und Diagrammelemente^^^^
7^Schriftfamilie^fontFamily^sans-serif^ ^1^sans-serif|serif|monospace^0^2^11^^^^^
8^Flächenfarbe^fill^blue^ ^1^ ^0^1^12^^^^^
9^Grid-Label-Höhe^gridLabelHeight^18^ ^1^ ^0^1^10^^^^^
10^Grid-Offset^gridChartOffset^3^ ^1^ ^0^1^10^^^^^
11^tickRotate^tickRotate^-45^ ^0^ ^0^1^5^^^^^
12^ticks^Einheit X-Achse^5^ ^0^ ^0^1^5^^^^^
13^tickSize^Abstand X-Achse und Beschriftung^10^ ^0^ ^0^1^5^^^^^
14^labelOffset^Abstand X-Achse Beschriftung^10^ ^0^ ^0^1^5^^^^^
15^Ausrichtung X-Achse Beschriftung^labelAnchor^center^ ^0^left|center|right^0^2^5^^^^^
16^Außenrand links^^^^1^^0^1^10^^^^^
17^Außenrand rechts^^^^1^^0^1^10^^^^^
18^Außenrand oben^^^^1^^0^1^10^^^^^
19^Außenrand unten^^^^1^^0^1^10^^^^^
20^Innenrand oben^^^^1^^0^1^10^^^^^
21^Innenrand unten^^^^1^^0^1^10^^^^^
22^Innenrand links^^^^1^^0^1^10^^^^^
23^Innenrand rechts^^^^1^^0^1^10^^^^^
24^Farbschema^scale.scheme^ ^ ^1^blues|greens^0^2^12^^^^^
25^Farbtyp^^^^1^^0^1^12^^^^^
43^Farbsättigung^^^^1^^0^1^12^^^^^
44^Strichfarbe^stroke^ ^ ^1^ ^0^1^12^^^^^
45^Strichdicke^strokeWidth^ ^ ^1^ ^0^1^12^^^^^
47^Werte X-Achse^Plot.groupX^ ^ ^1^Anzahl|Summe|Proportion|Minimum|Maximum|Durchschnitt|Varianz|Erster|Letzter^0^2^14^^^^^
55^Werte Y-Achse^Plot.groupY^ ^ ^1^Anzahl|Summe|Proportion|Minimum|Maximum|Durchschnitt|Varianz|Erster|Letzter^0^2^14^^^^^

10
src-modules/module/viz/schluesseltabellen/viz_property_group.unl

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
1^SIZE^Grafikgröße^
2^MARGIN^Abstände^
3^COLOR^Farben^
4^STYLES^Elementformatierung^
5^X^X-Achse^50^
6^Y^Y-Achse^40^
10^LAYOUT^Diagramm-Layout^10^
11^STYLE^Diagramm-Style^20^
12^ELEMENTS^Diagramm-Elemente^30^
14^DATACATEGORY^Wertekategorien^60^

2
src-modules/module/viz/schluesseltabellen/viz_property_group_renderer.unl

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
1^2^11^style^
2^2^10^ ^

3
src-modules/module/viz/schluesseltabellen/viz_property_input_type.unl

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
1^TEXT^Texteingabe^
2^SELECT^Select-Liste^
3^COLOR^Farbauswahl^
4^LEVER^Schieberegler^
4^RANGE^Schieberegler^
5^TEXTAREA^Großes Textfeld^

6
src-modules/module/viz/schluesseltabellen/viz_property_renderer.unl

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
1^2^2^width^
2^2^4^background^
3^2^5^color^
4^2^7^fontFamily^
5^2^6^fontSize^
6^2^1^height^

6
src-modules/module/viz/schluesseltabellen/viz_property_unload.x

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
DOQUERY "select * from viz_property order by 1,2" false ^ viz_property.unl
DOQUERY "select * from viz_property_input_type order by 1,2" false ^ viz_property_input_type.unl
DOQUERY "select * from viz_property_group order by 1,2" false ^ viz_property_group.unl
DOQUERY "select * from viz_renderer order by 1,2" false ^ viz_renderer.unl
DOQUERY "select * from viz_property_renderer order by 1,2" false ^ viz_property_renderer.unl
DOQUERY "select * from viz_property_group_renderer order by 1,2" false ^ viz_property_group_renderer.unl

6
src-modules/module/viz/schluesseltabellen/viz_property_upload.x

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
sx_auto_upload_table.x viz_property
sx_auto_upload_table.x viz_property_input_type
sx_auto_upload_table.x viz_property_group
sx_auto_upload_table.x viz_renderer
sx_auto_upload_table.x viz_property_renderer
sx_auto_upload_table.x viz_property_group_renderer

2
src-modules/module/viz/schluesseltabellen/viz_renderer.unl

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
1^d3js^D3JS^
2^plot^Observalbe Plot^
2^plot^Observable Plot^

6
superx/style/sx_viz_muster.css

@ -34,6 +34,12 @@ @@ -34,6 +34,12 @@
margin-left: 1.0em;
margin-top: 0.4em; }
.select { /*für SELECT Elemente*/
font-family: sans-serif;
font-weight: normal;
width:75px;
}
.control-new { /*für einheitliche Controlbreite*/
width: 17.0em;
}

197
superx/xml/js/viz/viz_functions.js

@ -160,7 +160,7 @@ function prepareChartProperties(chartType) @@ -160,7 +160,7 @@ function prepareChartProperties(chartType)
return false;
break;
}
renderForm("chartPropertiesForm",chartProperties);
renderForm("chartPropertiesForm",chartProperties,commonChartProperties);
renderFormDetails("chartPropertiesFormDetails",commonChartProperties);
return true;
@ -366,39 +366,45 @@ function fillSelectionResult(selectionRsMetaData) @@ -366,39 +366,45 @@ function fillSelectionResult(selectionRsMetaData)
}
function renderForm(formDiv,myChartProperties)
function renderForm(formDiv,myChartProperties,myCommonChartProperties)
{
//first empty form:
var myForm=document.getElementById(formDiv);
while (myForm.firstChild) {
myForm.removeChild(myForm.firstChild);
}
/*
const tabElem = document.createElement("table");
const columnsDiv = document.createElement("div");
columnsDiv.classList.add("columns");
const columnDiv = document.createElement("div");
columnDiv.classList.add("column");
columnDiv.classList.add("is-narrow");
const columnDivBox = document.createElement("div");
columnDivBox.classList.add("box");
columnDivBox.style="width: 500px";
for(var k=0;k < myChartProperties.length;k++)
{
columnDivBox.appendChild(renderDimensionField(myChartProperties[k]));
}
columnDiv.appendChild(columnDivBox);
columnsDiv.appendChild(columnDiv);
//title
const columnDivTitle = document.createElement("div");
columnDivTitle.classList.add("column");
columnDivTitle.classList.add("is-narrow");
const columnDivBoxTitle = document.createElement("div");
columnDivBoxTitle.classList.add("box");
columnDivBoxTitle.style="width: 500px";
for(var k=0;k < myCommonChartProperties.length;k++)
{
const rowElem = document.createElement("tr");
const tdCap = document.createElement("td");
const textnode = document.createTextNode(myChartProperties[k].caption);
tdCap.appendChild(textnode);
const tdSelElem = document.createElement("td");
const selElem = document.createElement("select");
selElem.name=myChartProperties[k].name;
selElem.id=myChartProperties[k].name;
fillSelectOptions(selElem,myChartProperties[k].getValueResultset(),myChartProperties[k].isMandatory);
tdSelElem.appendChild(selElem);
rowElem.appendChild(tdCap);
rowElem.appendChild(tdSelElem);
//here values, and then:
tabElem.appendChild( rowElem);
if(myCommonChartProperties[k].name=="chartCaption")
columnDivBoxTitle.appendChild(renderChartPropertyField(myCommonChartProperties[k]));
}
myForm.appendChild(tabElem);
*/
for(var k=0;k < myChartProperties.length;k++)
{
myForm.appendChild(renderDimensionField(myChartProperties[k]));
}
columnDivTitle.appendChild(columnDivBoxTitle);
columnsDiv.appendChild(columnDivTitle);
myForm.appendChild(columnsDiv);
}
function renderDimensionField(dimensionProperty)
@ -495,7 +501,7 @@ var previousGroup=""; @@ -495,7 +501,7 @@ var previousGroup="";
for(var k=0;k < myCommonChartProperties.length;k++)
{
var groupUniquename=myCommonChartProperties[k].groupUniquename;
if(groupUniquename != previousGroup)
if(groupUniquename!="" && groupUniquename != previousGroup)
{
var newcommonChartPropertyGroup = new commonChartPropertyGroup(myCommonChartProperties[k].groupCaption,groupUniquename);
commonChartPropertyGroups.push(newcommonChartPropertyGroup);
@ -553,39 +559,100 @@ function renderChartPropertyField(commonChartProperty) @@ -553,39 +559,100 @@ function renderChartPropertyField(commonChartProperty)
inputParaElem.classList.add("control-new");
const inputElem = document.createElement("div");
inputElem.classList.add("is-small");
inputElem.classList.add("is-fullwidth");
if(commonChartProperty.inputType=="TEXT")
{
//Einfaches Texteingabefeld:
const inpElem = document.createElement("input");
inpElem.type="TEXT";
inpElem.size=5;
inpElem.title=commonChartProperty.explanation;
inpElem.name=commonChartProperty.name;
inpElem.id=commonChartProperty.name;
inpElem.value=commonChartProperty.defaultValue;
inpElem.onchange= function () {
createChart('chartDiv');
};
inputElem.appendChild(inpElem);
inputParaElem.appendChild(inputElem);
//inputElem.classList.add("is-fullwidth");
switch (commonChartProperty.inputType) {
case "SELECT":
//select input:
inputElem.classList.add("select");
inputElem.classList.add("is-small");
const selElem = document.createElement("select");
selElem.name=commonChartProperty.name;
selElem.id=commonChartProperty.name;
selElem.title=commonChartProperty.explanation;
//selElem.style="width:50px";
if(commonChartProperty.rendererUniquename=="")
{
selElem.disabled="disabled";
selElem.readonly="readonly";
}
selElem.onchange= function () {
createChart('chartDiv');
};
fillSelectOptions(selElem,commonChartProperty.getValueResultset(),commonChartProperty.isMandatory);
inputElem.appendChild(selElem);
inputParaElem.appendChild(inputElem);
break;
case "TEXTAREA":
//großes Texteingabefeld:
const textAreaElem = document.createElement("textarea");
textAreaElem.cols="20";
textAreaElem.rows=3;
if(commonChartProperty.rendererUniquename=="")
{
textAreaElem.disabled="disabled";
textAreaElem.readonly="readonly";
}
textAreaElem.title=commonChartProperty.explanation;
textAreaElem.name=commonChartProperty.name;
textAreaElem.id=commonChartProperty.name;
textAreaElem.value=commonChartProperty.defaultValue;
textAreaElem.onchange= function () {
createChart('chartDiv');
};
inputElem.appendChild(textAreaElem);
inputParaElem.appendChild(inputElem);
break;
case "RANGE":
//Einfaches Texteingabefeld:
const rangeElem = document.createElement("input");
rangeElem.type="RANGE";
rangeElem.min=commonChartProperty.range_from;
rangeElem.max=commonChartProperty.range_to;
rangeElem.step=50;
if(commonChartProperty.rendererUniquename=="")
{
rangeElem.disabled="disabled";
rangeElem.readonly="readonly";
}
rangeElem.title=commonChartProperty.explanation;
rangeElem.name=commonChartProperty.name;
rangeElem.id=commonChartProperty.name;
rangeElem.value=commonChartProperty.defaultValue;
rangeElem.onchange= function () {
createChart('chartDiv');
};
inputElem.appendChild(rangeElem);
inputParaElem.appendChild(inputElem);
break;
default:
//Einfaches Texteingabefeld:
const inpElem = document.createElement("input");
inpElem.type="TEXT";
inpElem.size=5;
if(commonChartProperty.rendererUniquename=="")
{
inpElem.disabled="disabled";
inpElem.readonly="readonly";
}
inpElem.title=commonChartProperty.explanation;
inpElem.name=commonChartProperty.name;
inpElem.id=commonChartProperty.name;
inpElem.value=commonChartProperty.defaultValue;
inpElem.onchange= function () {
createChart('chartDiv');
};
inputElem.appendChild(inpElem);
inputParaElem.appendChild(inputElem);
break;
}
else
{
//select input:
inputElem.classList.add("select");
const selElem = document.createElement("select");
selElem.name=commonChartProperty.name;
selElem.id=commonChartProperty.name;
selElem.title=commonChartProperty.explanation;
selElem.onchange= function () {
createChart('chartDiv');
};
fillSelectOptions(selElem,commonChartProperty.getValueResultset(),commonChartProperty.isMandatory);
inputElem.appendChild(selElem);
inputParaElem.appendChild(inputElem);
}
inputFieldElem.appendChild(inputParaElem);
fieldElem.appendChild(inputFieldElem);
return fieldElem;
@ -672,6 +739,10 @@ const tabElem = document.createElement("table"); @@ -672,6 +739,10 @@ const tabElem = document.createElement("table");
tabElem.border="1";
tabElem.width="100%";
const rowElem = document.createElement("tr");
const thCap = document.createElement("th");
const textnode = document.createTextNode("Zeilennr.");
thCap.appendChild(textnode);
rowElem.appendChild(thCap);
for(var col=0;col < metadata.length;col++)
{
if(metadata[col].nr)
@ -689,6 +760,10 @@ for(row=1;row<rowcount;row++) @@ -689,6 +760,10 @@ for(row=1;row<rowcount;row++)
if(data[row])
{
const rowElem = document.createElement("tr");
const tdCap = document.createElement("td");
const textnode = document.createTextNode(row);
tdCap.appendChild(textnode);
rowElem.appendChild(tdCap);
for(var col=0;col < metadata.length;col++)
{
if(metadata[col].nr)
@ -931,13 +1006,12 @@ function getChartOptions(categoryDim,measureDim,marksArray,chartOrientationVerti @@ -931,13 +1006,12 @@ function getChartOptions(categoryDim,measureDim,marksArray,chartOrientationVerti
var categoryDim=document.getElementById("dimension1").value;
var measureDim=document.getElementById("measure1").value;
var fontSizeDefault=getCommonChartProperty("fontSize")+"pt";
var myCaption=getCommonChartProperty("chartCaption");
var chartWidth=getCommonChartProperty("chartWidth");
var myFontFamily=getCommonChartProperty("font-family");
var myBgColor=getCommonChartProperty("background-color");
var myColor=getCommonChartProperty("color");
var myCaption=getCommonChartProperty("chartCaption");
var marginLeftDefault=chartWidth/5; //20% liner Rand
var marginLeftDefault=chartWidth/5; //20% linker Rand
var marginBottomDefault=100;
var categoryLabel=getColumnCaption(categoryDim);
var measureLabel=getColumnCaption(measureDim);
@ -945,7 +1019,8 @@ function getChartOptions(categoryDim,measureDim,marksArray,chartOrientationVerti @@ -945,7 +1019,8 @@ function getChartOptions(categoryDim,measureDim,marksArray,chartOrientationVerti
for(var k=0;k < commonChartProperties.length;k++)
{
if(commonChartProperties[k].groupUniquename=="STYLES")
if(commonChartProperties[k].name!="" && (commonChartProperties[k].groupUniquename=="STYLE"
|| commonChartProperties[k].groupUniquename=="LAYOUT"))
{
stylesString+=",\""+commonChartProperties[k].name+"\":\""+getCommonChartProperty(commonChartProperties[k].name)+"\"";
}

49
superx/xml/viz_html_chart.xsl

@ -126,17 +126,36 @@ padding-bottom:10px; @@ -126,17 +126,36 @@ padding-bottom:10px;
//document.body.append(Plot.plot(options));
function commonChartProperty(name,caption,isMandatory,inputType,staticValues,defaultValue,explanation,groupCaption,groupUniquename)
function commonChartProperty(name,
caption,
isMandatory,
inputType,
staticValues,
range_from,
range_to,
defaultValue,
explanation,
groupCaption,
groupUniquename,
rendererUniquename,
groupVariableName,
variableName
)
{
this.name=name;
this.caption=caption;
this.staticValues=staticValues;
this.range_from=range_from;
this.range_to=range_from;
this.isMandatory=isMandatory;
this.inputType=inputType;
this.defaultValue=defaultValue;
this.explanation=explanation;
this.groupCaption=groupCaption;
this.groupUniquename=groupUniquename;
this.rendererUniquename=rendererUniquename;
this.groupVariableName=groupVariableName;
this.variableName=variableName;
this.getValueResultset = function () {
var valueOptions=[];
var optionCounter=0;
@ -181,6 +200,10 @@ var newCommonChartProperty = new commonChartProperty("</xsl:text> @@ -181,6 +200,10 @@ var newCommonChartProperty = new commonChartProperty("</xsl:text>
,"</xsl:text>
<xsl:value-of select="@static_values" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@prop_range_from" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@prop_range_to" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@prop_default" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@explanation" />
@ -188,16 +211,36 @@ var newCommonChartProperty = new commonChartProperty("</xsl:text> @@ -188,16 +211,36 @@ var newCommonChartProperty = new commonChartProperty("</xsl:text>
<xsl:value-of select="@group_caption" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@group_uniquename" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@renderer_uniquename" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@group_variable_name" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@variable_name" />
<xsl:text>");
commonChartProperties.push(newCommonChartProperty);
</xsl:text>
</xsl:for-each>
<xsl:text>
var newCommonChartProperty = new commonChartProperty("chartCaption","Titel des Diagramms", false,"TEXT", "","</xsl:text>
<xsl:value-of select="/ergebnisse/ergebnis/maskenname" /><xsl:text>","wird unter dem Diagramm angezeigt","Diagrammkopf","TITLE");
var newCommonChartProperty = new commonChartProperty("chartCaption",
"Titel des Diagramms",
false,
"TEXTAREA",
"",
"",
"",
"</xsl:text>
<xsl:value-of select="/ergebnisse/ergebnis/maskenname" /><xsl:text>",
"wird unter dem Diagramm angezeigt",
"Diagrammkopf",
"",
"plot",
"",
"");
commonChartProperties.push(newCommonChartProperty);
</xsl:text>
</script>
<script language="Javascript" type="text/javascript" src="../xml/js/viz/viz_functions.js" />

Loading…
Cancel
Save