Skip to content

Commit 6126668

Browse files
author
bvenn
committed
add stackedArea chart
1 parent d3f5033 commit 6126668

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/FSharp.Plotly/Chart.fs

+15
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,21 @@ type Chart =
230230
let x,y = Seq.unzip xy
231231
Chart.SplineArea(x, y, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width,?Smoothing=Smoothing)
232232

233+
/// Emphasizes the degree of change over time and shows the relationship of the parts to a whole.
234+
static member StackedArea(x, y,?Name,?Showlegend,?MarkerSymbol,?Color,?Opacity,?Labels,?TextPosition,?TextFont,?Dash,?Width) =
235+
Trace.initScatter (
236+
TraceStyle.Scatter(X = x,Y = y, Mode=StyleParam.Mode.Lines) )
237+
|> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity)
238+
|> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width)
239+
|> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol)
240+
|> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont)
241+
|> TraceStyle.SetStackGroup "static"
242+
|> GenericChart.ofTraceObject
243+
244+
/// Emphasizes the degree of change over time and shows the relationship of the parts to a whole.
245+
static member StackedArea(xy,?Name,?Showlegend,?MarkerSymbol,?Color,?Opacity,?Labels,?TextPosition,?TextFont,?Dash,?Width) =
246+
let x,y = Seq.unzip xy
247+
Chart.StackedArea(x, y, ?Name=Name,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width)
233248

234249
/// Illustrates comparisons among individual items
235250
static member Column(keys, values,?Name,?Showlegend,?Color,?Opacity,?Labels,?TextPosition,?TextFont,?Marker) =

src/FSharp.Plotly/Trace.fs

+10
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,16 @@ module Trace =
276276
trace
277277
)
278278

279+
// Sets Stackgroup() to TraceObjects
280+
static member SetStackGroup
281+
(
282+
stackgroup: string
283+
) =
284+
(fun (trace:('T :> Trace)) ->
285+
286+
trace.SetValue("stackgroup", stackgroup)
287+
trace
288+
)
279289

280290
// #################################
281291
// # Charts

0 commit comments

Comments
 (0)