@ -1223,9 +1223,10 @@ function renderGeneralChartPropertiesForm(formDiv,myCommonChartProperties,render
@@ -1223,9 +1223,10 @@ function renderGeneralChartPropertiesForm(formDiv,myCommonChartProperties,render
{
var newcommonChartPropertyGroup = new commonChartPropertyGroup ( myCommonChartProperties [ k ] . groupCaption , groupUniquename , "" ) ;
commonChartPropertyGroups . push ( newcommonChartPropertyGroup ) ;
}
previousGroup = groupUniquename ;
}
}
const columnDiv = document . createElement ( "div" ) ;
for ( var i = 0 ; i < commonChartPropertyGroups . length ; i ++ )
{
@ -2529,11 +2530,12 @@ if(numberOfChildNodes>0)
@@ -2529,11 +2530,12 @@ if(numberOfChildNodes>0)
{
switch ( renderer ) {
case "plot" :
var myFigure = myChartDiv . childNodes [ 0 ] ;
if ( myFigure . childNodes . length > 0 )
for ( var i = 0 ; i < numberOfChildNodes ; i ++ )
{
var mySvg = myFigure . childNodes [ 0 ] ;
svg _xml = ( new XMLSerializer ) . serializeToString ( mySvg ) ;
var myNode = myChartDiv . childNodes [ i ] ;
var mySvg = myNode ;
// Extract the data as SVG text string
svg _xml += ( new XMLSerializer ) . serializeToString ( mySvg ) ;
}
break ;
case "d3js" :
@ -2542,7 +2544,7 @@ if(numberOfChildNodes>0)
@@ -2542,7 +2544,7 @@ if(numberOfChildNodes>0)
var myNode = myChartDiv . childNodes [ i ] ;
if ( myNode . nodeName == "svg" )
{
var mySvg = myNode ; //document.getElementById("chartSVG");
var mySvg = myNode ;
// Extract the data as SVG text string
svg _xml = ( new XMLSerializer ) . serializeToString ( mySvg ) ;
}
@ -2576,6 +2578,7 @@ else
@@ -2576,6 +2578,7 @@ else
}
function showChartModelCode ( )
{
var mySrcDiv = document . getElementById ( "chartModelsrc" ) ;
@ -2781,7 +2784,9 @@ for (let i = 1; i < 4; i++) {
@@ -2781,7 +2784,9 @@ for (let i = 1; i < 4; i++) {
function makeSankeyD3 ( myCommonChartProperties , mySvg , data , metaData , chartElem )
{
// load the data
var captionEmptyTarget = "Leer" ;
var captionEmptyTarget = getCommonChartPropertyFromModel ( myCommonChartProperties , "null_value_mask" ) ;
if ( captionEmptyTarget == "" )
captionEmptyTarget = "Leer" ;
var sNodes = getSankeyNodes ( data , captionEmptyTarget ) ; //graph.nodes;
var sLinks = getSankeyLinks ( sNodes , data ) ; //graph.links;
renderSankey ( myCommonChartProperties , mySvg , sNodes , sLinks ) ;
@ -2902,7 +2907,15 @@ var margin = { top: 10, right: 10, bottom: 10, left: 10 },
@@ -2902,7 +2907,15 @@ var margin = { top: 10, right: 10, bottom: 10, left: 10 },
var formatNumber = d3 . format ( ",.0f" ) , // zero decimal places
format = function ( d ) { return formatNumber ( d ) ; } ,
color = d3 . scaleOrdinal ( ) . range ( [ "#002060ff" , "#164490ff" , "#4d75bcff" , "#98b3e6ff" , "#d5e2feff" , "#008cb0ff" ] ) ;
var textColor = getCommonChartPropertyFromModel ( myCommonChartProperties , "color" ) ;
if ( textColor == "" )
textColor = "#3f3f3f" ;
var fontSize = getCommonChartPropertyFromModel ( myCommonChartProperties , "fontSize" ) ;
if ( fontSize == "" )
fontSize = "12pt" ;
var fontFamily = getCommonChartPropertyFromModel ( myCommonChartProperties , "fontFamily" ) ;
if ( fontFamily == "" )
fontFamily = "sans-serif" ;
// append the svg object to the body of the page
/ * c o n s t s a n k e y D i v = s v g . s e l e c t A l l ( " g " )
. attr ( "transform" ,
@ -2955,7 +2968,7 @@ var graph=sankey(data);
@@ -2955,7 +2968,7 @@ var graph=sankey(data);
var col = "rgb(" + r + "," + g + "," + b + ")" ;
return d . color = col ;
} )
/*.style("fill", d3.schemaPastel2)*/
@ -2985,7 +2998,21 @@ var graph=sankey(data);
@@ -2985,7 +2998,21 @@ var graph=sankey(data);
// add in the title for the nodes
node . append ( "text" )
. style ( "fill" , "#3f3f3f" )
. style ( "fill" , textColor )
. attr ( "x" , function ( d ) { return d . x0 - 6 ; } )
. attr ( "y" , function ( d ) { return ( d . y1 + d . y0 ) / 2 ; } )
. attr ( "dy" , "0.35em" )
. attr ( "font-size" , fontSize )
. attr ( "font-family" , fontFamily )
. attr ( "text-anchor" , "end" )
. text ( function ( d ) { return d . name ; } )
. filter ( function ( d ) { return d . x0 < width / 2 ; } )
. attr ( "x" , function ( d ) { return d . x1 + 6 ; } )
. attr ( "text-anchor" , "start" )
;
// add in the title for the nodes
/ * n o d e . a p p e n d ( " t e x t " )
. style ( "fill" , textColor )
. attr ( "x" , function ( d ) { return d . x0 - 6 ; } )
. attr ( "y" , function ( d ) { return ( d . y1 + d . y0 ) / 2 ; } )
. attr ( "dy" , "0.35em" )
@ -2995,5 +3022,19 @@ var graph=sankey(data);
@@ -2995,5 +3022,19 @@ var graph=sankey(data);
. filter ( function ( d ) { return d . x0 < width / 2 ; } )
. attr ( "x" , function ( d ) { return d . x1 + 6 ; } )
. attr ( "text-anchor" , "start" )
; * /
// add in the value labels for the nodes
node . append ( "text" )
. style ( "fill" , textColor )
. attr ( "x" , function ( d ) { return d . x0 + 20 ; } ) //rechte Seite
. attr ( "y" , function ( d ) { return ( d . y1 + d . y0 ) / 2 ; } )
. attr ( "dy" , "0.35em" )
. attr ( "font-size" , fontSize )
. attr ( "font-family" , fontFamily )
. attr ( "text-anchor" , "start" )
. text ( function ( d ) { return d . value ; } )
. filter ( function ( d ) { return d . x0 < width / 2 ; } )
. attr ( "x" , function ( d ) { return d . x1 - 40 ; } ) //linke Seite
. attr ( "text-anchor" , "start" )
;
}