FSharp.Charting shows separated window for each Chart in interactive mode

75 Views Asked by At

When I try to evaluate the following code in F# interactive console I get three separated chart windows (one for chartA, one for chartB and one for combined chart). How to prevent of displaying chart every time it's created? I want to display only the combined chart in single chart window.

let chartA = setA |> Chart.Point |> Chart.WithSeries.Style(System.Drawing.Color.Orange)
let chartB = setB |> Chart.Point |> Chart.WithSeries.Style(System.Drawing.Color.Gold)
let chartC = Chart.Combine [|chartA; chartB|]
1

There are 1 best solutions below

2
Funk On BEST ANSWER

You can use scope

let chartC = 
    let chartA = setA |> Chart.Point |> Chart.WithSeries.Style(System.Drawing.Color.Orange)
    let chartB = setB |> Chart.Point |> Chart.WithSeries.Style(System.Drawing.Color.Gold)
    Chart.Combine [|chartA; chartB|]

Or without the locals

let chartC (setA:seq<float*float>) (setB:seq<float*float>) = 
    [| setA |> Chart.Point |> Chart.WithSeries.Style(System.Drawing.Color.Orange) ;
       setB |> Chart.Point |> Chart.WithSeries.Style(System.Drawing.Color.Gold) |]
    |> Chart.Combine

Related Questions in F#

Related Questions in F#-INTERACTIVE