-
Notifications
You must be signed in to change notification settings - Fork 98
C# Layout Grid Example #187
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
Comments
You'll have to do it manually atm, i am currently working on an updated version of Chart.Grid that does this internally and will be easy to call from C# though. The necessary steps are:
Note that Boxplot is really awkward to use because it has no static type annotation for its parameters. This is something we should fix. using System;
using Plotly.NET;
using Plotly.NET.TraceObjects;
using Plotly.NET.LayoutObjects;
using static Plotly.NET.Chart2D;
using Microsoft.FSharp.Core;
namespace Plotly.NET.Tests.CSharp
{
class Program
{
static void Main(string[] args)
{
GenericChart.GenericChart c11 =
Chart2D.Chart.BoxPlot<string, int [], string, int, int, int ,int> (
x: "11",
y: new int[] { 1, 2, 3 }
)
.WithAxisAnchor(X: 1, Y: 1);
GenericChart.GenericChart c12 =
Chart2D.Chart.BoxPlot<string, int[], string, int, int, int, int>(
x: "12",
y: new int[] { 1, 2, 3 }
).WithAxisAnchor(X: 1, Y: 2);
GenericChart.GenericChart c21 =
Chart2D.Chart.BoxPlot<string, int[], string, int, int, int, int>(
x: "21",
y: new int[] { 1, 2, 3 }
).WithAxisAnchor(X: 2, Y: 1);
GenericChart.GenericChart c22 =
Chart2D.Chart.BoxPlot<string, int[], string, int, int, int, int>(
x: "22",
y: new int[] { 1, 2, 3 }
).WithAxisAnchor(X: 2, Y: 2);
Chart.Combine(new GenericChart.GenericChart[] { c11, c12, c21, c22 })
.WithXAxis(LinearAxis.init<string,string,string,string, string, string>(), StyleParam.SubPlotId.NewXAxis(1) )
.WithXAxis(LinearAxis.init<string,string,string,string, string, string>(), StyleParam.SubPlotId.NewXAxis(2) )
.WithYAxis(LinearAxis.init<string,string,string,string, string, string>(), StyleParam.SubPlotId.NewYAxis(1) )
.WithYAxis(LinearAxis.init<string,string,string,string, string, string>(), StyleParam.SubPlotId.NewYAxis(2) )
.WithLayoutGridStyle(Rows: 2, Columns: 2)
.Show();
}
}
} |
Awesome, Thank you for the help! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi ,
Can anyone help me with example code of performing Grid Layout of Box plot?
Thank you!
The text was updated successfully, but these errors were encountered: