#r "nuget: Plotly.NET, 2.0.0"
#r "nuget: Plotly.NET.Interactive, 2.0.0"
Summary: This example shows how to style polar layouts in F#.
let's first create some data for the purpose of creating example charts:
open Plotly.NET
// a coordinates
let a = [ 1; 2; 3; 4; 5; 6; 7;]
// b coordinates
let b = a |> List.rev
//c
let c = [ 2; 2; 2; 2; 2; 2; 2;]
Consider this combined ternary chart:
let combinedTernary =
[
Chart.PointTernary(a,b,c)
Chart.LineTernary(a,c,Sum = 10)
]
|> Chart.combine
combinedTernary
Use the Chart.withTernary
function and initialize a Ternary layout with the desired looks
open Plotly.NET.LayoutObjects
let styledTernary =
combinedTernary
|> Chart.withTernary(
Ternary.init(
AAxis = LinearAxis.init(Title = Title.init("A"), Color = Color.fromKeyword ColorKeyword.DarkOrchid),
BAxis = LinearAxis.init(Title = Title.init("B"), Color = Color.fromKeyword ColorKeyword.DarkRed)
)
)
styledTernary
You could pass these axes to Chart.withTernary
as above, but for the case where you want to specifically set one axis, there are the Chart.withAAxis
, Chart.withBAxis
, Chart.withCAxis
functions:
let styledTernary2 =
styledTernary
|> Chart.withCAxis(LinearAxis.init(Title = Title.init("C"), Color = Color.fromKeyword ColorKeyword.DarkCyan))
styledTernary2