Title: Any C# sample with connectgaps · plotly/Plotly.NET · Discussion #434 · GitHub
Open Graph Title: Any C# sample with connectgaps · plotly/Plotly.NET · Discussion #434
X Title: Any C# sample with connectgaps · plotly/Plotly.NET · Discussion #434
Description: Any C# sample with connectgaps
Open Graph Description: Hello, do you have any sample in C# to help create a line plot with connectgaps property ? I saw #146, but i don't know how to convert it from F# to C#. Thanks
X Description: Hello, do you have any sample in C# to help create a line plot with connectgaps property ? I saw #146, but i don't know how to convert it from F# to C#. Thanks
Opengraph URL: https://github.com/plotly/Plotly.NET/discussions/434
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Any C# sample with connectgaps","text":"Hello, do you have any sample in C# to help create a line plot with connectgaps property ?
\nI saw #146, but i don't know how to convert it from F# to C#.
\nThanks
","upvoteCount":2,"answerCount":3,"acceptedAnswer":{"@type":"Answer","text":"@davidsaurel thanks for this question. I am afraid that applying this in C# is quite hard because you must either apply the tracestyle function (which is very FSharpy as it takes a function as argument) or use dynamic object style.
\nThe first solution would look like this. It has the same problems that eventually lead to Plotly.NET.CSharp (see #322), namely the huge amount of generic type annotations that you just do not have to set using the function from F#.
\nHowever, as a workaround it at least works:
\nusing Plotly.NET.CSharp;\n\nvar chart = \n Chart.Scatter<float,int,string>(\n mode: Plotly.NET.StyleParam.Mode.Lines_Markers,\n x: new float[] { 1, 2, float.NaN, 4 },\n y: new int[] { 1, 2, 3, 4 }\n );\n\nPlotly.NET.GenericChart.mapTrace(\n Plotly.NET.Trace2DStyle.Scatter<float,float,float,float,float,float,float,float,float,float,float,float,float,float,Plotly.NET.Trace>(\n ConnectGaps: true\n ),\n chart\n);\n\nchart
\n\nI think we eventually need a WithTraceStyle extension member for charts in Plotly.NET.CSharp. I'll track that in a separate issue. Thanks for making this obvious to me.
","upvoteCount":1,"url":"https://github.com/plotly/Plotly.NET/discussions/434#discussioncomment-7562478"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:f2d2df1d-5677-de7d-c683-de5d6b0f32f2 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | A8C2:A5383:100D780:14A0CF3:698FEC18 |
| html-safe-nonce | 2c608ab92d2cab569c00fd3268e6137d43c7f6290d6600a7313b57cacd04a014 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEMyOkE1MzgzOjEwMEQ3ODA6MTRBMENGMzo2OThGRUMxOCIsInZpc2l0b3JfaWQiOiIyNDI1MTMwNzE5Njk5MjY2NTg0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b56d5d949b05c88e7c1360a6bbc48eca2be1e17099a8315b7d027d30d682e838 |
| hovercard-subject-tag | discussion:5848073 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/plotly/Plotly.NET/434/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/157363ae8ffae159c836787accb4667059f1a6ff9e646c4d6f889de1fc6071e1/plotly/Plotly.NET/discussions/434 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/157363ae8ffae159c836787accb4667059f1a6ff9e646c4d6f889de1fc6071e1/plotly/Plotly.NET/discussions/434 |
| og:image:alt | Hello, do you have any sample in C# to help create a line plot with connectgaps property ? I saw #146, but i don't know how to convert it from F# to C#. Thanks |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/Plotly.NET git https://github.com/plotly/Plotly.NET.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 58708375 |
| octolytics-dimension-repository_nwo | plotly/Plotly.NET |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 58708375 |
| octolytics-dimension-repository_network_root_nwo | plotly/Plotly.NET |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width