File tree 2 files changed +11
-1
lines changed
src/main/scala/co/theasi/plotly
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,15 @@ trait Figure {
17
17
* }}}
18
18
*/
19
19
def legend (newLegend : LegendOptions ): Self =
20
- withNewOptions(options.copy(legendOptions = newLegend))
20
+ withNewOptions(options.copy(legendOptions = newLegend, showLegend = Some (true )))
21
+
22
+ /** Show the legend */
23
+ def showLegend (): Self =
24
+ withNewOptions(options.copy(showLegend = Some (true )))
25
+
26
+ /** Hide the legend */
27
+ def hideLegend (): Self =
28
+ withNewOptions(options.copy(showLegend = Some (false )))
21
29
22
30
/** Set figure title */
23
31
def title (newTitle : String ): Self =
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package co.theasi.plotly
3
3
case class FigureOptions (
4
4
title : Option [String ],
5
5
legendOptions : LegendOptions ,
6
+ showLegend : Option [Boolean ],
6
7
margins : Margins ,
7
8
width : Option [Int ],
8
9
height : Option [Int ],
@@ -15,6 +16,7 @@ object FigureOptions {
15
16
def apply (): FigureOptions = FigureOptions (
16
17
title = None ,
17
18
legendOptions = LegendOptions (),
19
+ showLegend = None ,
18
20
margins = Margins (),
19
21
width = None ,
20
22
height = None ,
You can’t perform that action at this time.
0 commit comments