Ivan
Ivan

Reputation: 7746

How to display a chart from DataVisualization in Linqpad F#

Using Linqpad 5.0, I have code that looks like this:

open System
open System.Net

open System.Windows.Forms
open System.Windows.Forms.DataVisualization

open FSharp.Charting

...

module Chart = 
/// Creates a line chart from the given sequence using at 
/// most 'count' numbers and automatically adding X axis
let SimpleLine(seq, count) =
  seq |> Seq.truncate count
      |> Seq.mapi (fun i v -> i, v)
      |> Chart.Line

let chart = Chart.SimpleLine([1.0; 2.0; 4.0; 8.0], 3)

If I say

chart.Dump()

I see the typical Linqpad box, but not the chart itself.

Upvotes: 0

Views: 301

Answers (1)

Ivan
Ivan

Reputation: 7746

The following function call works:

chart.ShowChart()

Upvotes: 1

Related Questions