#r "nuget: Plotly.NET, 5.0.0"
#r "nuget: Plotly.NET.Interactive, 5.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 = a, B = b, C = c)
Chart.LineTernary(A = a, C = 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