
Summary: This example shows how to create polar bar charts in F#.
let's first create some data for the purpose of creating example charts:
open Plotly.NET
let r = [77.5; 72.5; 70.0; 45.0; 22.5; 42.5; 40.0; 62.5]
let r2 = [57.5; 50.0; 45.0; 35.0; 20.0; 22.5; 37.5; 55.0]
let r3 = [40.0; 30.0; 30.0; 35.0; 7.5; 7.5; 32.5; 40.0]
let r4 = [20.0; 7.5; 15.0; 22.5; 2.5; 2.5; 12.5; 22.5]
let t = ["North"; "N-E"; "East"; "S-E"; "South"; "S-W"; "West"; "N-W"]
Polar bar charts plot data on a radial axis and a categorical angular axis.
A common use case is the windrose chart.
A wind rose is a graphic tool used by meteorologists to give a succinct view
of how wind speed and direction are typically distributed at a particular location.
open Plotly.NET.LayoutObjects
let windrose1 =
[
Chart.BarPolar (r , t, Name="11-14 m/s", MarkerPatternShape = StyleParam.PatternShape.Checked)
Chart.BarPolar (r2, t, Name="8-11 m/s" , MarkerPatternShape = StyleParam.PatternShape.DiagonalChecked)
Chart.BarPolar (r3, t, Name="5-8 m/s" , MarkerPatternShape = StyleParam.PatternShape.VerticalLines)
Chart.BarPolar (r4, t, Name="< 5 m/s" , MarkerPatternShape = StyleParam.PatternShape.HorizontalLines)
]
|> Chart.combine
|> Chart.withAngularAxis(
AngularAxis.init(
CategoryOrder = StyleParam.CategoryOrder.Array,
CategoryArray = (["East"; "N-E"; "North"; "N-W"; "West"; "S-W"; "South"; "S-E";]) // set the order of the categorical axis
)
)
namespace Plotly
namespace Plotly.NET
val r: float list
val r2: float list
val r3: float list
val r4: float list
val t: string list
namespace Plotly.NET.LayoutObjects
val windrose1: GenericChart.GenericChart
type Chart =
static member AnnotatedHeatmap: zData: seq<#seq<'a1>> * annotationText: seq<#seq<string>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?X: seq<#IConvertible> * ?XGap: int * ?Y: seq<#IConvertible> * ?YGap: int * ?Text: 'a5 * ?MultiText: seq<'a5> * ?ColorBar: ColorBar * ?ColorScale: Colorscale * ?ShowScale: bool * ?ReverseScale: bool * ?ZSmooth: SmoothAlg * ?Transpose: bool * ?UseWebGL: bool * ?ReverseYAxis: bool * ?UseDefaults: bool -> GenericChart (requires 'a1 :> IConvertible and 'a5 :> IConvertible) + 1 overload
static member Area: x: seq<#IConvertible> * y: seq<#IConvertible> * ?ShowMarkers: bool * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: MarkerSymbol * ?MultiMarkerSymbol: seq<MarkerSymbol> * ?Marker: Marker * ?LineColor: Color * ?LineColorScale: Colorscale * ?LineWidth: float * ?LineDash: DrawingStyle * ?Line: Line * ?StackGroup: string * ?Orientation: Orientation * ?GroupNorm: GroupNorm * ?FillColor: Color * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible) + 1 overload
static member Bar: values: seq<#IConvertible> * ?Keys: seq<#IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?MarkerColor: Color * ?MarkerColorScale: Colorscale * ?MarkerOutline: Line * ?MarkerPatternShape: PatternShape * ?MultiMarkerPatternShape: seq<PatternShape> * ?MarkerPattern: Pattern * ?Marker: Marker * ?Base: #IConvertible * ?Width: 'a4 * ?MultiWidth: seq<'a4> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible and 'a4 :> IConvertible) + 1 overload
static member BoxPlot: ?X: seq<#IConvertible> * ?Y: seq<#IConvertible> * ?Name: string * ?ShowLegend: bool * ?Text: 'a2 * ?MultiText: seq<'a2> * ?FillColor: Color * ?MarkerColor: Color * ?Marker: Marker * ?Opacity: float * ?WhiskerWidth: float * ?BoxPoints: BoxPoints * ?BoxMean: BoxMean * ?Jitter: float * ?PointPos: float * ?Orientation: Orientation * ?OutlineColor: Color * ?OutlineWidth: float * ?Outline: Line * ?AlignmentGroup: string * ?OffsetGroup: string * ?Notched: bool * ?NotchWidth: float * ?QuartileMethod: QuartileMethod * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible) + 2 overloads
static member Bubble: x: seq<#IConvertible> * y: seq<#IConvertible> * sizes: seq<int> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: MarkerSymbol * ?MultiMarkerSymbol: seq<MarkerSymbol> * ?Marker: Marker * ?LineColor: Color * ?LineColorScale: Colorscale * ?LineWidth: float * ?LineDash: DrawingStyle * ?Line: Line * ?StackGroup: string * ?Orientation: Orientation * ?GroupNorm: GroupNorm * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible) + 1 overload
static member Candlestick: ``open`` : seq<#IConvertible> * high: seq<#IConvertible> * low: seq<#IConvertible> * close: seq<#IConvertible> * x: seq<#IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?Text: 'a5 * ?MultiText: seq<'a5> * ?Line: Line * ?IncreasingColor: Color * ?Increasing: FinanceMarker * ?DecreasingColor: Color * ?Decreasing: FinanceMarker * ?WhiskerWidth: float * ?UseDefaults: bool -> GenericChart (requires 'a5 :> IConvertible) + 1 overload
static member Column: values: seq<#IConvertible> * ?Keys: seq<#IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?MarkerColor: Color * ?MarkerColorScale: Colorscale * ?MarkerOutline: Line * ?MarkerPatternShape: PatternShape * ?MultiMarkerPatternShape: seq<PatternShape> * ?MarkerPattern: Pattern * ?Marker: Marker * ?Base: #IConvertible * ?Width: 'a4 * ?MultiWidth: seq<'a4> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible and 'a4 :> IConvertible) + 1 overload
static member Contour: zData: seq<#seq<'a1>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?X: seq<#IConvertible> * ?Y: seq<#IConvertible> * ?Text: 'a4 * ?MultiText: seq<'a4> * ?ColorBar: ColorBar * ?ColorScale: Colorscale * ?ShowScale: bool * ?ReverseScale: bool * ?Transpose: bool * ?ContourLineColor: Color * ?ContourLineDash: DrawingStyle * ?ContourLineSmoothing: float * ?ContourLine: Line * ?ContoursColoring: ContourColoring * ?ContoursOperation: ConstraintOperation * ?ContoursType: ContourType * ?ShowContourLabels: bool * ?ContourLabelFont: Font * ?Contours: Contours * ?FillColor: Color * ?NContours: int * ?UseDefaults: bool -> GenericChart (requires 'a1 :> IConvertible and 'a4 :> IConvertible)
static member Funnel: x: seq<#IConvertible> * y: seq<#IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?Width: float * ?Offset: float * ?Text: 'a2 * ?MultiText: seq<'a2> * ?TextPosition: TextPosition * ?MultiTextPosition: seq<TextPosition> * ?Orientation: Orientation * ?AlignmentGroup: string * ?OffsetGroup: string * ?MarkerColor: Color * ?MarkerOutline: Line * ?Marker: Marker * ?TextInfo: TextInfo * ?ConnectorLineColor: Color * ?ConnectorLineStyle: DrawingStyle * ?ConnectorFillColor: Color * ?ConnectorLine: Line * ?Connector: FunnelConnector * ?InsideTextFont: Font * ?OutsideTextFont: Font * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible)
static member Heatmap: zData: seq<#seq<'a1>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?X: seq<#IConvertible> * ?XGap: int * ?Y: seq<#IConvertible> * ?YGap: int * ?Text: 'a4 * ?MultiText: seq<'a4> * ?ColorBar: ColorBar * ?ColorScale: Colorscale * ?ShowScale: bool * ?ReverseScale: bool * ?ZSmooth: SmoothAlg * ?Transpose: bool * ?UseWebGL: bool * ?ReverseYAxis: bool * ?UseDefaults: bool -> GenericChart (requires 'a1 :> IConvertible and 'a4 :> IConvertible) + 1 overload
...
static member Chart.BarPolar: rTheta: seq<#System.IConvertible * #System.IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerPatternShape: StyleParam.PatternShape * ?MultiMarkerPatternShape: seq<StyleParam.PatternShape> * ?MarkerPattern: TraceObjects.Pattern * ?Marker: TraceObjects.Marker * ?Base: #System.IConvertible * ?Width: 'a4 * ?MultiWidth: seq<'a4> * ?UseDefaults: bool -> GenericChart.GenericChart (requires 'a2 :> System.IConvertible and 'a4 :> System.IConvertible)
static member Chart.BarPolar: r: seq<#System.IConvertible> * theta: seq<#System.IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'c * ?MultiText: seq<'c> * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerPatternShape: StyleParam.PatternShape * ?MultiMarkerPatternShape: seq<StyleParam.PatternShape> * ?MarkerPattern: TraceObjects.Pattern * ?Marker: TraceObjects.Marker * ?Base: #System.IConvertible * ?Width: 'e * ?MultiWidth: seq<'e> * ?UseDefaults: bool -> GenericChart.GenericChart (requires 'c :> System.IConvertible and 'e :> System.IConvertible)
module StyleParam
from Plotly.NET
type PatternShape =
| None
| DiagonalDescending
| DiagonalAscending
| DiagonalChecked
| HorizontalLines
| VerticalLines
| Checked
| Dots
member Convert: unit -> obj
override ToString: unit -> string
static member convert: (PatternShape -> obj)
static member toString: (PatternShape -> string)
union case StyleParam.PatternShape.Checked: StyleParam.PatternShape
union case StyleParam.PatternShape.DiagonalChecked: StyleParam.PatternShape
union case StyleParam.PatternShape.VerticalLines: StyleParam.PatternShape
union case StyleParam.PatternShape.HorizontalLines: StyleParam.PatternShape
static member Chart.combine: gCharts: seq<GenericChart.GenericChart> -> GenericChart.GenericChart
static member Chart.withAngularAxis: angularAxis: AngularAxis * ?Id: int -> (GenericChart.GenericChart -> GenericChart.GenericChart)
Multiple items
type AngularAxis =
inherit DynamicObj
new: unit -> AngularAxis
static member init: ?Visible: bool * ?AxisType: AxisType * ?AutoTypeNumbers: AutoTypeNumbers * ?CategoryOrder: CategoryOrder * ?CategoryArray: seq<#IConvertible> * ?ThetaUnit: AngularUnit * ?Period: float * ?Direction: Direction * ?Rotation: int * ?HoverFormat: string * ?UIRevision: #IConvertible * ?Color: Color * ?ShowLine: bool * ?LineColor: Color * ?LineWidth: int * ?ShowGrid: bool * ?GridColor: Color * ?GridWidth: int * ?TickMode: TickMode * ?NTicks: int * ?Tick0: #IConvertible * ?DTick: #IConvertible * ?TickVals: seq<#IConvertible> * ?TickText: seq<#IConvertible> * ?Ticks: TickOptions * ?TickLen: int * ?TickWidth: int * ?TickColor: Color * ?ShowTickLabels: bool * ?ShowTickPrefix: ShowTickOption * ?TickPrefix: string * ?ShowTickSuffix: ShowTickOption * ?TickSuffix: string * ?ShowExponent: ShowExponent * ?ExponentFormat: ExponentFormat * ?MinExponent: float * ?SeparateThousands: bool * ?TickFont: Font * ?TickAngle: int * ?TickFormat: string * ?TickFormatStops: seq<TickFormatStop> * ?Layer: Layer -> AngularAxis
static member style: ?Visible: bool * ?AxisType: AxisType * ?AutoTypeNumbers: AutoTypeNumbers * ?CategoryOrder: CategoryOrder * ?CategoryArray: seq<#IConvertible> * ?ThetaUnit: AngularUnit * ?Period: float * ?Direction: Direction * ?Rotation: int * ?HoverFormat: string * ?UIRevision: #IConvertible * ?Color: Color * ?ShowLine: bool * ?LineColor: Color * ?LineWidth: int * ?ShowGrid: bool * ?GridColor: Color * ?GridWidth: int * ?TickMode: TickMode * ?NTicks: int * ?Tick0: #IConvertible * ?DTick: #IConvertible * ?TickVals: seq<#IConvertible> * ?TickText: seq<#IConvertible> * ?Ticks: TickOptions * ?TickLen: int * ?TickWidth: int * ?TickColor: Color * ?ShowTickLabels: bool * ?ShowTickPrefix: ShowTickOption * ?TickPrefix: string * ?ShowTickSuffix: ShowTickOption * ?TickSuffix: string * ?ShowExponent: ShowExponent * ?ExponentFormat: ExponentFormat * ?MinExponent: float * ?SeparateThousands: bool * ?TickFont: Font * ?TickAngle: int * ?TickFormat: string * ?TickFormatStops: seq<TickFormatStop> * ?Layer: Layer -> (AngularAxis -> AngularAxis)
<summary>Angular axes can be used as a scale for the angular coordinates in polar plots.</summary>
--------------------
new: unit -> AngularAxis
static member AngularAxis.init: ?Visible: bool * ?AxisType: StyleParam.AxisType * ?AutoTypeNumbers: StyleParam.AutoTypeNumbers * ?CategoryOrder: StyleParam.CategoryOrder * ?CategoryArray: seq<#System.IConvertible> * ?ThetaUnit: StyleParam.AngularUnit * ?Period: float * ?Direction: StyleParam.Direction * ?Rotation: int * ?HoverFormat: string * ?UIRevision: #System.IConvertible * ?Color: Color * ?ShowLine: bool * ?LineColor: Color * ?LineWidth: int * ?ShowGrid: bool * ?GridColor: Color * ?GridWidth: int * ?TickMode: StyleParam.TickMode * ?NTicks: int * ?Tick0: #System.IConvertible * ?DTick: #System.IConvertible * ?TickVals: seq<#System.IConvertible> * ?TickText: seq<#System.IConvertible> * ?Ticks: StyleParam.TickOptions * ?TickLen: int * ?TickWidth: int * ?TickColor: Color * ?ShowTickLabels: bool * ?ShowTickPrefix: StyleParam.ShowTickOption * ?TickPrefix: string * ?ShowTickSuffix: StyleParam.ShowTickOption * ?TickSuffix: string * ?ShowExponent: StyleParam.ShowExponent * ?ExponentFormat: StyleParam.ExponentFormat * ?MinExponent: float * ?SeparateThousands: bool * ?TickFont: Font * ?TickAngle: int * ?TickFormat: string * ?TickFormatStops: seq<TickFormatStop> * ?Layer: StyleParam.Layer -> AngularAxis
type CategoryOrder =
| Trace
| CategoryAscending
| CategoryDescending
| Array
| TotalAscending
| TotalDescending
| MinAscending
| MinDescending
| MaxAscending
| MaxDescending
...
member Convert: unit -> obj
override ToString: unit -> string
static member convert: (CategoryOrder -> obj)
static member toString: (CategoryOrder -> string)
<summary>
Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied.
Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names.
Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode.
The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values.
Similarly, the order can be determined by the min, max, sum, mean or median of all the values.
</summary>
union case StyleParam.CategoryOrder.Array: StyleParam.CategoryOrder
module GenericChart
from Plotly.NET
<summary>
Module to represent a GenericChart
</summary>
val toChartHTML: gChart: GenericChart.GenericChart -> string
<summary>
Converts a GenericChart to it HTML representation. The div layer has a default size of 600 if not specified otherwise.
</summary>