Summary: This example shows how to create bar and a column charts in F#.
let's first create some data for the purpose of creating example charts:
open Plotly.NET let values = [20; 14; 23;] let keys = ["Product A"; "Product B"; "Product C";]
A bar chart or bar graph is a chart that presents grouped data with rectangular bars with lengths proportional to the values that they represent. The bars can be plotted vertically or horizontally. A vertical bar chart is called a column bar chart.
let column = Chart.Column(values,keys)
let bar = Chart.Bar(values,keys)
The following example shows how to create a stacked bar chart by combining bar charts created by combining multiple
Basically those charts are just normal bar/column charts with the Layout property
BarMode set to
Stack. You can do this yourself by changing the Chart layout.
let stackedBar = [ Chart.StackedBar(values,keys,Name="old"); Chart.StackedBar([8; 21; 13;],keys,Name="new") ] |> Chart.combine
(* ### Stacked bar Charts *) let stackedColumn = [ Chart.StackedColumn(values,keys,Name="old"); Chart.StackedColumn([8; 21; 13;],keys,Name="new") ] |> Chart.combine