Skip to content

Commit fade1c7

Browse files
muehlmuehl
authored andcommitted
Add z axis support
1 parent a01faea commit fade1c7

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

docs/content/3d-line-plots.fsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Chart.Scatter3d(x,y,z,StyleParam.Mode.Lines_Markers)
3131
|> Chart.withY_AxisStyle("y-axis")
3232
|> Chart.withZ_AxisStyle("z-axis")
3333
|> Chart.withSize(800.,800.)
34-
3534
(*** include-it:scatter3d_line_1 ***)
3635

3736

src/FSharp.Plotly/ChartExtensions.fs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,20 +156,20 @@ module ChartExtensions =
156156

157157

158158

159-
//// Sets z-Axis of 3d- Charts
160-
//static member withZ_Axis(zAxis:Axis.LinearAxis) =
161-
// (fun (ch:GenericChart) ->
162-
// let layout =
163-
// Layout()
164-
// |> Layout.style(Scene=Scene.init(Scene.style (zAxis=zAxis) ))
165-
// GenericChart.addLayout layout ch
166-
// )
159+
// Sets z-Axis of 3d- Charts
160+
static member withZ_Axis(zAxis:Axis.LinearAxis) =
161+
(fun (ch:GenericChart) ->
162+
let layout =
163+
Layout()
164+
|> Layout.style(Scene=Scene.init(zAxis=zAxis) )
165+
GenericChart.addLayout layout ch
166+
)
167167

168-
//// Sets z-Axis style with ...
169-
//static member withZ_AxisStyle(title,?MinMax,?Showgrid) =
170-
// let range = if MinMax.IsSome then Some (StyleParam.RangeValues.MinMax (MinMax.Value)) else None
171-
// let zaxis = Axis.LinearAxis.init(Axis.LinearAxis.LinearAxis(Title=title,?Range=range,?Showgrid=Showgrid))
172-
// Chart.withZ_Axis(zaxis)
168+
// Sets z-Axis style with ...
169+
static member withZ_AxisStyle(title,?MinMax,?Showgrid,?Showline) =
170+
let range = if MinMax.IsSome then Some (StyleParam.RangeValues.MinMax (MinMax.Value)) else None
171+
let zaxis = Axis.LinearAxis.init(Title=title,?Range=range,?Showgrid=Showgrid,?Showline=Showline)
172+
Chart.withZ_Axis(zaxis)
173173

174174

175175

0 commit comments

Comments
 (0)