Title: How do you pass GenericChart[] to Chart.Grid()? · plotly/Plotly.NET · Discussion #497 · GitHub
Open Graph Title: How do you pass GenericChart[] to Chart.Grid()? · plotly/Plotly.NET · Discussion #497
X Title: How do you pass GenericChart[] to Chart.Grid()? · plotly/Plotly.NET · Discussion #497
Description: How do you pass GenericChart[] to Chart.Grid()?
Open Graph Description: Hello, friend 👋 Thank you for the awesome library! I'm developing in C#, and I wonder how do you pass in GenericChart[] to Chart.Grid()? I intend to display all my charts in a dashboard manner (in ...
X Description: Hello, friend 👋 Thank you for the awesome library! I'm developing in C#, and I wonder how do you pass in GenericChart[] to Chart.Grid()? I intend to display all my charts in a dashboard manner ...
Opengraph URL: https://github.com/plotly/Plotly.NET/discussions/497
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"How do you pass GenericChart[] to Chart.Grid()?","text":"Hello, friend 👋
\nThank you for the awesome library!
\nI'm developing in C#, and I wonder how do you pass in GenericChart[] to Chart.Grid()?
\nI intend to display all my charts in a dashboard manner (in grid).
\nstatic void CreateAndOpenCharts(GenericChart[] charts, string fileName)\n{\n var dashboardChart = Chart.Grid(\n gCharts: charts,\n nRows: charts.Length,\n nCols: 2)\n .WithTitle(\"Core Loop Dashboard Report\")\n .WithSize(1200, 600 * charts.Length); \n\n var filePath = Path.Combine(Environment.CurrentDirectory, $\"{fileName}.html\");\n dashboardChart.SaveHtml(filePath);\n FileUtility.OpenFile($\"{fileName}.html\");\n}
\nThe documentation has an example, but it seems like the syntax is outdated, and cannot compile. Or is it just me not knowing how this syntax works?
\nvar chartCombined = new []{scatter,bar};\nChart.Grid<IEnumerable<GenericChart.GenericChart>>(1,2).Invoke(chartCombined)
\nSorry for the noob question.
\nAny help would be appreciated! 🙏
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"I didn't know using Plotly.NET.CSharp; is needed to show Grid() with gCharts overload. So the solution is,
\nusing Plotly.NET.CSharp;\n...\nstatic void CreateAndOpenCharts(GenericChart[] charts, string fileName)\n{\n var dashboardChart = Plotly.NET.CSharp.Chart.Grid(charts, charts.Length, 2)\n .WithTitle(\"Core Loop Dashboard Report\")\n .WithSize(1200, 600 * charts.Length);\n\n var filePath = Path.Combine(Environment.CurrentDirectory, $\"{fileName}.html\");\n Plotly.NET.CSharp.GenericChartExtensions.SaveHtml(dashboardChart, filePath);\n FileUtility.OpenFile($\"{fileName}.html\");\n}
\nThank you, Kevin!
\nYou're the best ❤️ !
","upvoteCount":1,"url":"https://github.com/plotly/Plotly.NET/discussions/497#discussioncomment-14853858"}}}
| 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:f874e26a-fc4a-80d3-61da-175fd041fcc8 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | 9622:13D965:E86E55:13D1A05:698F0E1C |
| html-safe-nonce | be3b9d2d4adef00d322c2c5faba9435583f2648a5db500bcbaaff900ac5d3eec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjIyOjEzRDk2NTpFODZFNTU6MTNEMUEwNTo2OThGMEUxQyIsInZpc2l0b3JfaWQiOiI3MjA1NjAzNjQ0Mjc5ODE5ODA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c0afd2a32362074fa664cf5aa2c17283b4f6f5c11e4ee2d5c3a3749bbd0bf3d3 |
| hovercard-subject-tag | discussion:9098003 |
| 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/497/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/b0753bb1b18e823ed780338585a94702b0a24a452848cc72457094b74441cc6e/plotly/Plotly.NET/discussions/497 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b0753bb1b18e823ed780338585a94702b0a24a452848cc72457094b74441cc6e/plotly/Plotly.NET/discussions/497 |
| og:image:alt | Hello, friend 👋 Thank you for the awesome library! I'm developing in C#, and I wonder how do you pass in GenericChart[] to Chart.Grid()? I intend to display all my charts in a dashboard manner (in ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2da1a0d1318592c9965539b12269c4641177dfabfc86c3807992efb13e1d96ff |
| 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 | d735bf238a2094bebd08cd3641a9ef4d1fe77e4b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width