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

Chart.Scatter "connectgaps" abstraction missing #146

Closed
gaviei opened this issue Aug 25, 2021 · 1 comment
Closed

Chart.Scatter "connectgaps" abstraction missing #146

gaviei opened this issue Aug 25, 2021 · 1 comment

Comments

@gaviei
Copy link

gaviei commented Aug 25, 2021

The example "Connect Data Gaps" in https://plotly.com/python/line-charts/#connect-data-gaps requires the assignment of the property "connectgaps" which is missing in the abstraction:

open Plotly.NET

let xs = [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15]

let chart = Chart.Scatter(xs,
             [10.; 20.; nan; 15.; 10.; 5.; 15.;nan; 20.; 10.; 10.; 15.; 25.; 20.; 10.], 
             StyleParam.Mode.Lines_Markers, Name="<b>No</b> Gaps")
             |> GenericChart.mapTrace(fun t -> 
                                                t?connectgaps <- true // workaround
                                                t)
[
    
    chart;
    Chart.Scatter(xs,
             [5.; 15.; nan; 10.; 5.; 0.; 10.; nan; 15.; 5.; 5.; 10.; 20.; 15.; 5.], 
             StyleParam.Mode.Lines_Markers, Name="Gaps")
] |> Chart.Combine

plot

@kMutagene
Copy link
Collaborator

It is there in TraceStyle.Scatter:

let xs = [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15]

[
    Chart.Line(
        xs,
        [10.; 20.; nan; 15.; 10.; 5.; 15.;nan; 20.; 10.; 10.; 15.; 25.; 20.; 10.], 
        Name="<b>No</b> Gaps"
    )
    |> GenericChart.mapTrace (Trace.TraceStyle.Scatter(Connectgaps = true))
        

    Chart.Scatter(xs,
             [5.; 15.; nan; 10.; 5.; 0.; 10.; nan; 15.; 5.; 5.; 10.; 20.; 15.; 5.], 
             StyleParam.Mode.Lines_Markers, Name="Gaps")
] 
|> Chart.combine
|> Chart.show

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