f# - FSharpChart: two scales on same graphic -


i'm using fsharpchart print on same graphic moving average , volume of stock. problem 1 graphic goes 20 50 more or less, other 0 80 mln, when combine two, 1 split bottom , useless. can have 2 different scales on y-axis 2 graphic "merge" correctly?

you can if set axistype of 1 of series axistype.secondary. of course it's make sure axis labels, legend, etc make clear data maps scale.

open fsharp.charting open system.windows.forms.datavisualization.charting  let squareschart = [ 1 .. 100 ] |> list.map (fun n -> (n, n*n)) |> chart.line let cubeschart   = [ 1 .. 100 ] |> list.map (fun n -> (n, n*n*n)) |> chart.line  let bad =      [ squareschart        cubeschart ]     |> chart.combine  let =      [ squareschart       cubeschart |> chart.withseries.axistype(yaxistype = axistype.secondary) ]     |> chart.combine 

bad:

enter image description here

good:

enter image description here

this works, in quick testing i've done write answer, appears fsharp.charting has bugs whereby customizations "infectious." after creating "good" chart, secondary axis appears when don't want it:

// secondary axis sticks around bad |> chart.withtitle(text = "why secondary axis?")  // title , secondary axis *both* stick around! chart.rows [bad; good] 

enter image description here enter image description here


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -