fslaborg / FSharp.Charting

Charting library suitable for interactive F# scripting
http://fslab.org/FSharp.Charting/
Other
216 stars 67 forks source link

Render chart without Forms pop up. #128

Open ghost opened 7 years ago

ghost commented 7 years ago

RE: https://stackoverflow.com/questions/19649525/fsharpchart-saveas-saves-blank-image-if-called-before-chart-rendering-is-comp/44184418#44184418

Issue of being unable to save image without calling SaveChart() and pop up Forms window.

   /// Render the chart in a new ChartControl without requiring a forms window
    member ch.RenderChart () =
    let frm = new Form(Visible = false, TopMost = true, Width = 700, Height = 500)
    let ctl = new ChartControl(ch, Dock = DockStyle.Fill)
    frm.Controls.Add(ctl)

suggested fix also slightly hacky, thoughts?