File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ module GenericChart =
8282 | MultiChart ( t,_) -> MultiChart ( t, layout)
8383
8484
85-
8685 // Adds a Layout function to the GenericChart
8786 let addLayout layout gChart =
8887 match gChart with
@@ -91,6 +90,16 @@ module GenericChart =
9190 | MultiChart ( traces, l') ->
9291 MultiChart ( traces, ( DynObj.combine l' layout |> unbox))
9392
93+ /// Returns a tuple containing the width and height of a GenericChart's layout if the property is set, otherwise returns None
94+ let tryGetLayoutSize gChart =
95+ let layout = getLayout gChart
96+ let width , height =
97+ ReflectionHelper.tryGetPropertyValueAs< float> layout " width" ,
98+ ReflectionHelper.tryGetPropertyValueAs< float> layout " height"
99+ match ( width, height) with
100+ |( Some w, Some h) -> Some ( w, h)
101+ |_ -> None
102+
94103 // // Adds multiple Layout functions to the GenericChart
95104 // let addLayouts layouts gChart =
96105 // match gChart with
You can’t perform that action at this time.
0 commit comments