@ -44,6 +44,7 @@ function chartModel(id,name,renderer,datasources)
@@ -44,6 +44,7 @@ function chartModel(id,name,renderer,datasources)
this . chartElements = new Array ( ) ;
this . options = new Object ;
this . options . marks = new Array ( ) ;
this . options . sort = new Array ( ) ;
//let globalProperties={};
this . getChartSVG = function ( ) {
@ -173,7 +174,7 @@ var valueOptions=[];
@@ -173,7 +174,7 @@ var valueOptions=[];
var optionCounter = 0 ;
//selectionRsMetaData=fillSelectionResultMetaData();
//console.log("felder"+selectionRsMetaData.length);
var isDefault = tru e;
var isDefault = fals e;
for ( var j = 0 ; j < rsColumnMetaData [ datasource ] . length ; j ++ )
{
if ( rsColumnMetaData [ datasource ] [ j ] . colcaption . trim ( ) != ""
@ -341,7 +342,7 @@ function renderChart(chartDiv,currentChartModel)
@@ -341,7 +342,7 @@ function renderChart(chartDiv,currentChartModel)
if ( document . getElementById ( "chartName" ) . value == "" )
document . getElementById ( "chartName" ) . value = vizInitialName ;
if ( currentChartModel . chartElements . length > 0 )
if ( currentChartModel . chartElements . length > 0 && currentChartModel . chartElements [ 0 ] )
{
var mySVG = currentChartModel . getChartSVG ( ) ;
if ( typeof mySVG === 'object' )
@ -482,18 +483,7 @@ function createChartElementsConfig2Form(renderer)
@@ -482,18 +483,7 @@ function createChartElementsConfig2Form(renderer)
}
saveBtnDiv . appendChild ( saveBtn ) ;
elementDivBox . appendChild ( saveBtnDiv ) ;
//remove:
const removeBtnDiv = document . createElement ( "div" ) ;
const removeBtn = document . createElement ( "input" ) ;
removeBtn . type = "BUTTON" ;
removeBtn . value = "Entfernen" ;
removeBtn . classList . add ( "button" ) ;
removeBtn . classList . add ( "is-small" ) ;
removeBtn . onclick = function ( ) {
removeChartElementConfig ( )
}
removeBtnDiv . appendChild ( removeBtn ) ;
elementDivBox . appendChild ( removeBtnDiv ) ;
formChartElementConfig2Div . appendChild ( elementDivBox ) ;
/ * c o l u m n s D i v . a p p e n d C h i l d ( c o l u m n D i v ) ;
@ -547,7 +537,7 @@ function saveChartElementConfig()
@@ -547,7 +537,7 @@ function saveChartElementConfig()
while ( formChartElementConfig2Div . firstChild ) {
formChartElementConfig2Div . removeChild ( formChartElementConfig2Div . firstChild ) ;
}
document . getElementById ( "vizElementCounter" ) . value = myChartModel . chartElements . length ;
renderChart ( 'chartDiv' , myChartModel ) ;
/ * v a r m a r k s A r r a y = n e w A r r a y ( ) ;
@ -565,15 +555,18 @@ function removeChartElementConfig()
@@ -565,15 +555,18 @@ function removeChartElementConfig()
{
var propertyCounter = myChartModel . chartElements . length ;
var elemID = document . getElementById ( "chartElementID" ) . value ;
if ( propertyCounter > 0 )
{
var elemID = myChartModel . chartElements [ propertyCounter - 1 ] . nr ;
/ * v a r f i l t e r e d = m y C h a r t M o d e l . c h a r t E l e m e n t s . f i l t e r ( o b j = > o b j . n r ! = = p r o p e r t y C o u n t e r - 1 ) ;
myChartModel . chartElements = filtered ; * /
delete myChartModel . chartElements [ propertyCounter - 1 ] ;
//delete myChartModel.chartElements[propertyCounter-1];
myChartModel . chartElements . pop ( ) ;
elemID -- ;
document . getElementById ( "chartElementID" ) . value = elemID ;
if ( document . getElementById ( "chartElementID" ) )
document . getElementById ( "chartElementID" ) . value = elemID ;
document . getElementById ( "vizElementCounter" ) . value = myChartModel . chartElements . length ;
renderChart ( 'chartDiv' , myChartModel ) ;
}
}