Skip to content

Commit ba49bc9

Browse files
author
bvenn
committed
add table documentation
update docs generation
1 parent 6bfc9e3 commit ba49bc9

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

docsrc/content/table.fsx

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
(*** hide ***)
2+
#r "netstandard"
3+
#r @"../../lib/Formatting/FSharp.Plotly.dll"
4+
5+
(**
6+
# FSharp.Plotly: Tables
7+
8+
This example shows how to create tables in F#.
9+
10+
11+
*)
12+
13+
open FSharp.Plotly
14+
open FSharp.Plotly.StyleParam
15+
16+
let header = ["RowIndex";"A";"simple";"table"]
17+
let rows =
18+
[
19+
["0";"I";"am";"a"]
20+
["1";"little";"example";"!"]
21+
]
22+
23+
let table1 =
24+
Chart.Table(header, rows)
25+
26+
27+
28+
(***do-not-eval***)
29+
table1 |> Chart.Show
30+
31+
(*** include-value:table1 ***)
32+
33+
(**
34+
A little bit of styling:
35+
*)
36+
37+
let table2 =
38+
Chart.Table(
39+
header,
40+
rows,
41+
//sets global header alignment
42+
AlignHeader= [HorizontalAlign.Center],
43+
//sets alignment for each column separately (The last alignment is applied to all potential following columns)
44+
AlignCells= [HorizontalAlign.Left;HorizontalAlign.Center;HorizontalAlign.Right],
45+
//sets global header color
46+
ColorHeader="#45546a",
47+
//sets single header color to each header column
48+
//ColorHeader=["#45546a";"#deebf7";"#45546a";"#deebf7"],
49+
//sets global cell color
50+
//ColorRows="#deebf7",
51+
//sets single header color to each header column
52+
ColorCells=["#deebf7";"lightgrey";"#deebf7";"lightgrey"],
53+
//sets font of header
54+
FontHeader=Font.init(FontFamily.Courier_New, Size=12, Color="white"),
55+
//sets the height of the header
56+
HeightHeader= 30.,
57+
//sets lines of header
58+
LineHeader=Line.init(2.,"black"),
59+
ColumnWidth=[70;50;100;70],
60+
//defines order of columns
61+
ColumnOrder= [1;2;3;4]
62+
)
63+
64+
(***do-not-eval***)
65+
table2 |> Chart.Show
66+
67+
(*** include-value:table2 ***)
68+
69+
(**
70+
FastA Representation
71+
72+
*)
73+
74+
75+
76+

docsrc/tools/templates/template.cshtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
<li><a href="@Root/multiple-charts.html">Multiple Charts</a></li>
8282
<li><a href="@Root/errorbars.html">Error bars</a></li>
8383
<li><a href="@Root/shapes.html">Shapes</a></li>
84+
<li class="nav-header">Plotly Tables</li>
85+
<li><a href="@Root/table.html">Table</a></li>
8486
<li class="nav-header">Plotly WPF</li>
8587
<li><a href="@Root/plotly-wpf.html">Using Plotly PopUp window</a></li>
8688

lib/Formatting/FSharp.Plotly.dll

12.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)