plotly / Plotly.NET

interactive graphing library for .NET programming languages :chart_with_upwards_trend:
https://plotly.net
MIT License
663 stars 88 forks source link

Axis styling not applied for 3D charts anymore #381

Closed kMutagene closed 1 year ago

kMutagene commented 1 year ago

seems like somewhere in the plotly.js version increses, a fallback for xaxis and yaxis for scene objects has been lost, where the 3d plot would get the styles from the layout object sirectly when not set on scene.

This can be verified by comparing to using withZAxisStyle, as that function sets properties on the scene directly:

Does not work:

#r "nuget: Plotly.NET"
#r "nuget: Plotly.NET.Interactive"

open Plotly.NET
open Plotly.NET.LayoutObjects

Chart.Point3D([1,2,3])
|> Chart.withXAxis(LinearAxis.init(Title = Title.init(Text = "axis title")))
|> Chart.withYAxis(LinearAxis.init(Title = Title.init(Text = "axis title")))
|> Chart.withZAxis(LinearAxis.init(Title = Title.init(Text = "axis title")))

image

works:

r "nuget: Plotly.NET"

r "nuget: Plotly.NET.Interactive"

open Plotly.NET open Plotly.NET.LayoutObjects

let myScene = Scene.init( XAxis = LinearAxis.init(Title = Title.init(Text = "axis title")), YAxis = LinearAxis.init(Title = Title.init(Text = "axis title")), ZAxis = LinearAxis.init(Title = Title.init(Text = "axis title")) )

Chart.Point3D([1,2,3]) |> Chart.withScene(myScene)

image

bvenn commented 1 year ago

I assume the described effect is intended. It is explicitly stated in the documentation to set the styling via the scene object

kMutagene commented 1 year ago

Seems like i just forgot about it :D