@@ -28,9 +28,12 @@ type Chart =
2828
2929 /// Uses points to represent data points
3030 static member Point ( x , y ,? Name ,? Showlegend ,? MarkerSymbol ,? Color ,? Opacity ,? Labels ,? TextPosition ,? TextFont ) =
31+ // if text position or font is set than show labels (not only when hovering)
32+ let changeMode = StyleOption.ModeUtils.showText ( TextPosition.IsSome || TextFont.IsSome)
33+
3134 let trace =
3235 TraceObjects.Scatter()
33- |> Options.Scatter( X = x, Y = y, Mode = StyleOption.Markers)
36+ |> Options.Scatter( X = x, Y = y, Mode = changeMode StyleOption.Markers)
3437 |> Options.ITraceInfo( ?Name= Name,? Showlegend= Showlegend,? Opacity= Opacity)
3538 |> Options.IMarker( Options.Marker( ?Color= Color,? Symbol= MarkerSymbol))
3639 |> Options.ITextLabel( ?Text= Labels,? Textposition= TextPosition,? Textfont= TextFont)
@@ -44,13 +47,19 @@ type Chart =
4447
4548 /// Uses lines to represent data points
4649 static member Line ( x , y ,? Name ,? ShowMarkers ,? Showlegend ,? MarkerSymbol ,? Color ,? Opacity ,? Labels ,? TextPosition ,? TextFont ,? Dash ,? Width ) =
47- let mode ' =
48- match ShowMarkers with
49- | Some show -> if show then StyleOption.Lines_ Markers else StyleOption.Lines
50- | None -> StyleOption.Lines_ Markers // default
50+ // if text position or font is set than show labels (not only when hovering)
51+ let changeMode =
52+ let isShowMarker =
53+ match ShowMarkers with
54+ | Some isShow -> isShow
55+ | None -> false
56+ StyleOption.ModeUtils.showText ( TextPosition.IsSome || TextFont.IsSome)
57+ >> StyleOption.ModeUtils.showMarker ( isShowMarker)
58+
59+
5160 let trace =
5261 TraceObjects.Scatter()
53- |> Options.Scatter( X = x, Y = y, Mode = mode' )
62+ |> Options.Scatter( X = x, Y = y, Mode = ( changeMode StyleOption.Mode.Lines ))
5463 |> Options.ITraceInfo( ?Name= Name,? Showlegend= Showlegend,? Opacity= Opacity)
5564 |> Options.ILine( Options.Line( ?Color= Color,? Dash= Dash,? Width= Width))
5665 |> Options.IMarker( Options.Marker( ?Color= Color,? Symbol= MarkerSymbol))
@@ -65,13 +74,16 @@ type Chart =
6574
6675 /// A Line chart that plots a fitted curve through each data point in a series.
6776 static member Spline ( x , y ,? Name ,? ShowMarkers ,? Showlegend ,? MarkerSymbol ,? Color ,? Opacity ,? Labels ,? TextPosition ,? TextFont ,? Dash ,? Width ,? Smoothing ) =
68- let mode ' =
69- match ShowMarkers with
70- | Some show -> if show then StyleOption.Lines_ Markers else StyleOption.Lines
71- | None -> StyleOption.Lines_ Markers // default
77+ let changeMode =
78+ let isShowMarker =
79+ match ShowMarkers with
80+ | Some isShow -> isShow
81+ | None -> false
82+ StyleOption.ModeUtils.showText ( TextPosition.IsSome || TextFont.IsSome)
83+ >> StyleOption.ModeUtils.showMarker ( isShowMarker)
7284 let trace =
7385 TraceObjects.Scatter()
74- |> Options.Scatter( X = x, Y = y, Mode = mode' , ?Fillcolor= Color)
86+ |> Options.Scatter( X = x, Y = y, Mode = ( changeMode StyleOption.Mode.Lines ) , ?Fillcolor= Color)
7587 |> Options.ITraceInfo( ?Name= Name,? Showlegend= Showlegend,? Opacity= Opacity)
7688 |> Options.ILine( Options.Line( ?Color= Color,? Dash= Dash,? Width= Width, Shape= StyleOption.Shape.Spline, ?Smoothing= Smoothing))
7789 |> Options.IMarker( Options.Marker( ?Color= Color,? Symbol= MarkerSymbol))
@@ -86,9 +98,12 @@ type Chart =
8698
8799 /// A variation of the Point chart type, where the data points are replaced by bubbles of different sizes.
88100 static member Bubble ( x , y , sizes : seq < #IConvertible >,? Name ,? Showlegend ,? MarkerSymbol ,? Color ,? Opacity ,? Labels ,? TextPosition ,? TextFont ) =
101+ // if text position or font is set than show labels (not only when hovering)
102+ let changeMode = StyleOption.ModeUtils.showText ( TextPosition.IsSome || TextFont.IsSome)
103+
89104 let trace =
90105 TraceObjects.Scatter()
91- |> Options.Scatter( X = x, Y = y, Mode = StyleOption.Markers)
106+ |> Options.Scatter( X = x, Y = y, Mode = changeMode StyleOption.Markers)
92107 |> Options.ITraceInfo( ?Name= Name,? Showlegend= Showlegend,? Opacity= Opacity)
93108 |> Options.IMarker( Options.Marker( ?Color= Color,? Symbol= MarkerSymbol, MultiSizes= sizes))
94109 |> Options.ITextLabel( ?Text= Labels,? Textposition= TextPosition,? Textfont= TextFont)
@@ -102,12 +117,18 @@ type Chart =
102117
103118 /// Displays a range of data by plotting two Y values per data point, with each Y value being drawn as a line
104119 static member Range ( x , y , upper , lower ,? Name ,? ShowMarkers ,? Showlegend ,? Color ,? RangeColor ,? Labels ,? TextPosition ,? TextFont ) =
105- let mode ' = match ShowMarkers with
106- | Some show -> if show then StyleOption.Lines_ Markers else StyleOption.Lines
107- | None -> StyleOption.Lines_ Markers // default
120+ // if text position or font is set than show labels (not only when hovering)
121+ let changeMode =
122+ let isShowMarker =
123+ match ShowMarkers with
124+ | Some isShow -> isShow
125+ | None -> false
126+ StyleOption.ModeUtils.showText ( TextPosition.IsSome || TextFont.IsSome)
127+ >> StyleOption.ModeUtils.showMarker ( isShowMarker)
128+
108129 let trace =
109130 TraceObjects.Scatter()
110- |> Options.Scatter( X = x, Y = y, Mode = mode' , ?Fillcolor= Color)
131+ |> Options.Scatter( X = x, Y = y, Mode = changeMode StyleOption.Mode.Lines , ?Fillcolor= Color)
111132 |> Options.ITraceInfo( ?Name= Name,? Showlegend= Showlegend)
112133 |> Options.ILine( Options.Line( ?Color= Color))
113134 |> Options.IMarker( Options.Marker( ?Color= Color))
@@ -134,13 +155,18 @@ type Chart =
134155
135156 /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole.
136157 static member Area ( x , y ,? Name ,? ShowMarkers ,? Showlegend ,? MarkerSymbol ,? Color ,? Opacity ,? Labels ,? TextPosition ,? TextFont ,? Dash ,? Width ) =
137- let mode ' =
138- match ShowMarkers with
139- | Some show -> if show then StyleOption.Lines_ Markers else StyleOption.Lines
140- | None -> StyleOption.Lines // default
158+ // if text position or font is set than show labels (not only when hovering)
159+ let changeMode =
160+ let isShowMarker =
161+ match ShowMarkers with
162+ | Some isShow -> isShow
163+ | None -> false
164+ StyleOption.ModeUtils.showText ( TextPosition.IsSome || TextFont.IsSome)
165+ >> StyleOption.ModeUtils.showMarker ( isShowMarker)
166+
141167 let trace =
142168 TraceObjects.Scatter()
143- |> Options.Scatter( X = x, Y = y, Mode = mode' , Fill= StyleOption.ToZero_ y)
169+ |> Options.Scatter( X = x, Y = y, Mode = changeMode StyleOption.Mode.Lines , Fill= StyleOption.ToZero_ y)
144170 |> Options.ITraceInfo( ?Name= Name,? Showlegend= Showlegend,? Opacity= Opacity)
145171 |> Options.ILine( Options.Line( ?Color= Color,? Dash= Dash,? Width= Width))
146172 |> Options.IMarker( Options.Marker( ?Color= Color,? Symbol= MarkerSymbol))
@@ -155,13 +181,17 @@ type Chart =
155181
156182 /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole.
157183 static member SplineArea ( x , y ,? Name ,? ShowMarkers ,? Showlegend ,? MarkerSymbol ,? Color ,? Opacity ,? Labels ,? TextPosition ,? TextFont ,? Dash ,? Width ,? Smoothing ) =
158- let mode ' =
159- match ShowMarkers with
160- | Some show -> if show then StyleOption.Lines_ Markers else StyleOption.Lines
161- | None -> StyleOption.Lines // default
184+ // if text position or font is set than show labels (not only when hovering)
185+ let changeMode =
186+ let isShowMarker =
187+ match ShowMarkers with
188+ | Some isShow -> isShow
189+ | None -> false
190+ StyleOption.ModeUtils.showText ( TextPosition.IsSome || TextFont.IsSome)
191+ >> StyleOption.ModeUtils.showMarker ( isShowMarker)
162192 let trace =
163193 TraceObjects.Scatter()
164- |> Options.Scatter( X = x, Y = y, Mode = mode' , Fill= StyleOption.ToZero_ y)
194+ |> Options.Scatter( X = x, Y = y, Mode = changeMode StyleOption.Mode.Lines , Fill= StyleOption.ToZero_ y)
165195 |> Options.ITraceInfo( ?Name= Name,? Showlegend= Showlegend,? Opacity= Opacity)
166196 |> Options.ILine( Options.Line( Shape= StyleOption.Shape.Spline,? Color= Color,? Dash= Dash,? Width= Width,? Smoothing= Smoothing))
167197 |> Options.IMarker( Options.Marker( ?Color= Color,? Symbol= MarkerSymbol))
0 commit comments