File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ if(ko) { //add Knockout bindings. Requires that IDD loaded after Knockout
3737 var strokeBinding = allBindings . get ( 'iddStroke' ) ;
3838 stroke = ko . unwrap ( strokeBinding ) ;
3939 }
40+ var shape = undefined ;
41+ if ( allBindings . has ( 'iddShape' ) ) {
42+ var shapeBinding = allBindings . get ( 'iddShape' ) ;
43+ shape = ko . unwrap ( shapeBinding ) ;
44+ }
45+ var color = undefined ;
46+ if ( allBindings . has ( 'iddColor' ) ) {
47+ var colorBinding = allBindings . get ( 'iddColor' ) ;
48+ color = ko . unwrap ( colorBinding ) ;
49+ }
4050 var unwrappedX = ko . unwrap ( xBindings ) ;
4151 var plotAttr = element . getAttribute ( "data-idd-plot" ) ;
4252 if ( plotAttr != null ) {
@@ -56,10 +66,10 @@ if(ko) { //add Knockout bindings. Requires that IDD loaded after Knockout
5666 }
5767 element . innerHTML = csvDataToDraw ;
5868
59- if ( typeof stroke != 'undefined' ) {
6069 //saving stroke color in the data-idd-style attribute: will be picked up by initialization
61- element . setAttribute ( "data-idd-style" , "stroke: " + stroke + "; thickness: " + lineThickness ) ;
62- }
70+ element . setAttribute ( "data-idd-style" , ( stroke ? "stroke: " + stroke + "; thickness: " + lineThickness + ";" : "" ) +
71+ ( shape ? "shape: " + shape + ";" : "" ) +
72+ ( color ? "color: " + color + ";" : "" ) ) ;
6373 }
6474 }
6575 }
You can’t perform that action at this time.
0 commit comments