Skip to content

Commit dec461c

Browse files
author
Timo Mühlhaus
committed
2 parents aa7c93a + 52e5d87 commit dec461c

24 files changed

+1009
-831
lines changed

docs/content/3d-scatter-plots.fsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
#r "../../bin/FSharp.Plotly.dll"
44

55
(**
6-
# FSharp.Plotly: Pie and Doughnut Charts
6+
# FSharp.Plotly: Scatter3d Charts
77
8-
*Summary:* This example shows how to create pie and doughnut charts in F#.
8+
*Summary:* This example shows how to create three-dimensional scatter charts in F#.
99
10-
A pie or a doughnut chart can be created using the `Chart.Pie` and `Chart.Doughnut` functions.
11-
When creating pie or doughnut charts, it is usually desirable to provide both labels and
12-
values.
10+
A Scatter3d chart report shows a three-dimensional spinnable view of your data
1311
*)
1412

1513
open FSharp.Plotly
@@ -20,10 +18,15 @@ let z = [19; 26; 55;]
2018

2119

2220
(*** define-output:scatter3d_1 ***)
23-
Chart3d.Scatter(x,y,z,StyleOption.Mode.Markers)
21+
Chart.Scatter3d(x,y,z,StyleOption.Mode.Markers)
22+
|> Chart.withX_AxisStyle("my x-axis")
23+
|> Chart.withY_AxisStyle("my y-axis")
24+
|> Chart.withZ_AxisStyle("my z-axis")
25+
|> Chart.withSize(800.,800.)
26+
2427
(*** include-it:scatter3d_1 ***)
25-
|> Chart3d.withSize(900.,900.)
26-
|> Chart3d.Show
28+
|> Chart.Show
29+
2730

2831

2932

docs/content/area-plots.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ Chart.Area(x,y)
2626
(*** define-output:area2 ***)
2727
Chart.SplineArea(x,y)
2828
(*** include-it:area2 ***)
29-
|> Chart.Show
29+
3030

docs/content/bar-charts.fsx

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,39 @@
55
(**
66
# FSharp.Plotly: Pie and Doughnut Charts
77
8-
*Summary:* This example shows how to create pie and doughnut charts in F#.
8+
*Summary:* This example shows how to create bar and a column charts in F#.
99
10-
A pie or a doughnut chart can be created using the `Chart.Pie` and `Chart.Doughnut` functions.
11-
When creating pie or doughnut charts, it is usually desirable to provide both labels and
12-
values.
10+
A bar chart or bar graph is a chart that presents grouped data with rectangular bars with
11+
lengths proportional to the values that they represent. The bars can be plotted vertically
12+
or horizontally. A vertical bar chart is called a column bar chart.
1313
*)
1414

1515
open FSharp.Plotly
1616

17-
let yValues = [20; 14; 23;]
18-
let xValues = ["Product A"; "Product B"; "Product C";]
19-
let labels = ["27% market share"; "24% market share"; "19% market share";]
20-
21-
(*** define-output:pie1 ***)
22-
Chart.Bar(xValues,yValues,Labels=labels,Opacity=0.3,Marker=Options.Marker(Color="rgba(222,45,38,0.8)"))
23-
|> Chart.withSize(500.,500.)
24-
(*** include-it:pie1 ***)
25-
|> Chart.Show
17+
let values = [20; 14; 23;]
18+
let keys = ["Product A"; "Product B"; "Product C";]
19+
let labels = ["27% market share"; "24% market share"; "19% market share";]
20+
21+
(*** define-output:bar1 ***)
22+
Chart.Column(keys,values,Labels=labels,Opacity=0.3,Marker=Options.Marker(Color="rgba(222,45,38,0.8)"))
23+
(*** include-it:bar1 ***)
24+
25+
(*** define-output:bar2 ***)
26+
Chart.Bar(keys,values)
27+
(*** include-it:bar2 ***)
28+
29+
30+
(**
31+
32+
## Stacked bar chart or column charts
33+
The following example shows how to create a stacked bar chart by combining bar charts created by `Chart.StackedBar`
34+
*)
35+
2636

37+
(*** define-output:bar3 ***)
38+
[
39+
Chart.StackedBar(keys,values,Name="old");
40+
Chart.StackedBar(keys,[8; 21; 13;],Name="new")
41+
]
42+
|> Chart.Combine
43+
(*** include-it:bar3 ***)

docs/content/box-plots.fsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ let x = ["bin1";"bin2";"bin1";"bin2";"bin1";"bin2";"bin1";"bin1";"bin2";"bin1"]
1818

1919
(*** define-output:box1 ***)
2020
Chart.BoxPlot(x,y,Jitter=0.3,Boxpoints=StyleOption.Boxpoints.Outliers)
21-
//|> Chart.Show
2221
(*** include-it:box1 ***)

docs/content/contour-plots.fsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,4 @@ let z =
4444
z
4545
|> Chart.Contour
4646
|> Chart.withSize(600.,600.)
47-
(*** include-it:contour1 ***)
48-
|> Chart.Show
49-
50-
51-
47+
(*** include-it:contour1 ***)

docs/content/getting-started.fsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// This block of code is omitted in the generated HTML documentation. Use
33
// it to define helpers that you do not want to show in the documentation.
44
#r "../../bin/Newtonsoft.Json.dll"
5+
#r "../../lib/FSharp.Care.dll"
56

67
(**
78
FSharp.Plotly
@@ -36,5 +37,10 @@ GenericChart.ofTraceObject trace layout
3637
|> Chart.Show
3738

3839

40+
let red = FSharp.Care.Colors.Table.Office.red
41+
let red' = FSharp.Care.Colors.toHex false red
3942

43+
Chart.Point([1; 2; 3; 4],[12; 9; 15; 12])
44+
|> Chart.withMarkerStyle(Color=red')
45+
|> Chart.Show
4046

docs/content/pie-daughnut-charts.fsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ Chart.Pie(values,labels)
2222
(*** include-it:pie1 ***)
2323

2424
(*** define-output:doughnut1 ***)
25-
Chart.Doughnut(values,labels,Hole=0.3)
25+
Chart.Doughnut(values,labels,Hole=0.3,Text=labels)
2626
(*** include-it:doughnut1 ***)
27+
|> Chart.Show
28+
29+

docs/tools/formatters.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ let createFsiEvaluator root output =
4343

4444
| :? GenericChart.GenericChart as ch ->
4545
// Just return the inline HTML for a Plotly chart
46-
let html = GenericChart.toChartHtmlWithSize 760 500 ch
46+
let html = GenericChart.toChartHtmlWithSize 500 500 ch
4747
Some [InlineBlock <| html]
4848

4949
| _ -> None

docs/tools/templates/template.cshtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@
4949
<li><a href="@Root/bubble-charts.html">Bubble Charts</a></li>
5050
<li><a href="@Root/contour-plots.html">Contour Plots</a></li>
5151
<li><a href="@Root/heatmaps.html">Heatmaps</a></li>
52-
<li><a href="@Root/histograms.html">Histograms</a></li>
53-
<li><a href="@Root/2d-histograms.html">2D Histograms</a></li>
52+
@*<li><a href="@Root/histograms.html">Histograms</a></li>
53+
<li><a href="@Root/2d-histograms.html">2D Histograms</a></li>*@
5454
<li><a href="@Root/line-scatter-plots.html">Line and Scatter Plots</a></li>
5555
<li><a href="@Root/pie-daughnut-charts.html">Pie and Doughnut Charts</a></li>
5656
<li><a href="@Root/polar-charts.html">Polar Charts</a></li>
5757
<li><a href="@Root/range-plots.html">Range Plots</a></li>
5858
<li class="nav-header">Plotly 3d-Charts</li>
59-
<li><a href="@Root/3d-line-plots.html">3D Line Plots</a></li>
60-
<li><a href="@Root/3d-scatter-plots.html">3D Scatter Plots</a></li>
61-
<li><a href="@Root/3d-surface-plots.html">3D Surface Plots</a></li>
59+
<li><a href="@Root/3d-scatter-plots.html">3D Scatter Plots</a></li>
60+
@*<li><a href="@Root/3d-line-plots.html">3D Line Plots</a></li>
61+
<li><a href="@Root/3d-surface-plots.html">3D Surface Plots</a></li>*@
6262
<li class="nav-header">Plotly WPF</li>
6363
<li><a href="@Root/plotly-wpf.html">Using Plotly PopUp window</a></li>
6464

lib/FSharp.Care.dll

-1 KB
Binary file not shown.

0 commit comments

Comments
 (0)