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 =
82
82
| MultiChart ( t,_) -> MultiChart ( t, layout)
83
83
84
84
85
-
86
85
// Adds a Layout function to the GenericChart
87
86
let addLayout layout gChart =
88
87
match gChart with
@@ -91,6 +90,16 @@ module GenericChart =
91
90
| MultiChart ( traces, l') ->
92
91
MultiChart ( traces, ( DynObj.combine l' layout |> unbox))
93
92
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
+
94
103
// // Adds multiple Layout functions to the GenericChart
95
104
// let addLayouts layouts gChart =
96
105
// match gChart with
You can’t perform that action at this time.
0 commit comments