Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

share X-axis in Chart.Stack #38

Closed
hoangdungt2 opened this issue Jun 2, 2020 · 4 comments
Closed

share X-axis in Chart.Stack #38

hoangdungt2 opened this issue Jun 2, 2020 · 4 comments
Assignees

Comments

@hoangdungt2
Copy link

Hi again,
Really enjoy the package so far. I notice on the plotly documentation there is a section about share axis subplots:
https://plotly.com/python/subplots/ with the option of shared_xaxes=True, wonder how I can do the same in FSharp.Plotly, I played around with Chart.withX_AxisStyle and Chart.withX_Axis but didn't go anywhere. Do give some advice, thanks.

@kMutagene
Copy link
Member

Hi there again,

I'm glad you like it! What you want to do is something that I think we definitely should offer. However looking into it I didn't get the subplot grid working directly. When I have a working prototype I will get back at you and publish a prerelease package so you can test it. Thanks for reporting what you are doing with our library, it's really interesting to see.

@hoangdungt2
Copy link
Author

Thanks Kevin, I'm using FSharp.Plotly in several projects in my company, certainly looking forward to the new features.

@kMutagene kMutagene self-assigned this Jun 7, 2020
kMutagene added a commit that referenced this issue Jun 7, 2020
@kMutagene
Copy link
Member

kMutagene commented Jun 8, 2020

Hi @hoangdungt2 , i implemented a new version of the chart, Chart.SingleStack, wich is a version of the also fresh Chart.Grid with only 1 column. Here is a snippet that should get you what you want for shared xAxis:

[
    Chart.Point([(0,1)]) |> Chart.withY_AxisStyle("This title")
    Chart.Point([(0,1)]) 
    |> Chart.withY_AxisStyle("Must be set",Zeroline=false)
    Chart.Point([(0,1)]) 
    |> Chart.withY_AxisStyle("on the respective charts",Zeroline=false)
]
|> Chart.SingleStack
|> Chart.withLayoutGridStyle(XSide=StyleParam.LayoutGridXSide.Bottom)
|> Chart.withTitle("Hi i am the new SingleStackChart")
|> Chart.withX_AxisStyle("im the shared xAxis")
|> Chart.Show

For more than one column, you can use Chart.Grid. Should be available as a new prerelease package here.

@hoangdungt2
Copy link
Author

hi Kevin,
Big thanks, the new nuget package works perfectly for me.
Really appreciate your quick action 👍👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants