Skip to content

Commit c06844e

Browse files
committed
Add C# binding for Chart.Table
1 parent a2aa37b commit c06844e

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,38 @@ public static GenericChart.GenericChart Sankey<IdsType>(
624624
UseDefaults: UseDefaults.ToOption()
625625
);
626626

627+
/// <summary>
628+
/// Creates a table.
629+
///
630+
/// The data are arranged in a grid of rows and columns. Most styling can be specified for columns, rows or individual cells. Table is using a row-major order per default, ie. the grid is represented as a vector of row vectors.
631+
/// </summary>
632+
/// <param name="header">Sets the header of the table</param>
633+
/// <param name="cells">Sets the cells of the table</param>
634+
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover.</param>
635+
/// <param name="ColumnOrder">Specifies the rendered order of the data columns; for example, a value `2` at position `0` means that column index `0` in the data will be rendered as the third column, as columns have an index base of zero.</param>
636+
/// <param name="ColumnWidth">The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths.</param>
637+
/// <param name="MultiColumnWidth">The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths.</param>
638+
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
639+
public static GenericChart.GenericChart Table(
640+
TableCells header,
641+
TableCells cells,
642+
Optional<string> Name = default,
643+
Optional<IEnumerable<int>> ColumnOrder = default,
644+
Optional<double> ColumnWidth = default,
645+
Optional<IEnumerable<double>> MultiColumnWidth = default,
646+
Optional<bool> UseDefaults = default
647+
)
648+
=>
649+
Plotly.NET.ChartDomain.Chart.Table(
650+
header: header,
651+
cells: cells,
652+
Name: Name.ToOption(),
653+
ColumnOrder: ColumnOrder.ToOption(),
654+
ColumnWidth: ColumnWidth.ToOption(),
655+
MultiColumnWidth: MultiColumnWidth.ToOption(),
656+
UseDefaults: UseDefaults.ToOption()
657+
);
658+
627659
/// <summary>
628660
/// Creates an Indicator chart.
629661
///

tests/Plotly.NET.Tests.CSharpConsole/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,6 @@ static void Main(string[] args)
726726
Labels: new string [] {"A", "B"},
727727
Name: "pie"
728728
),
729-
Chart.Doughnut<double,string,string>(
730-
values: new double [] {69, 420},
731-
Labels: new string [] {"A", "B"},
732-
Name: "doughnut"
733-
),
734729
Chart.Sunburst<string, string, int, string, string>(
735730
Values: new int [] {19, 26, 55},
736731
labels: new string [] {"A", "B", "C"},
@@ -767,6 +762,7 @@ static void Main(string[] args)
767762
Value: new int [] {1, 2, 5}
768763
)
769764
),
765+
770766

771767
//smith traces
772768
Chart.ScatterSmith<double,double,string>(

0 commit comments

Comments
 (0)