Files
2026-07-23 14:37:19 +02:00

35 lines
885 B
FSharp

open Plotly.NET
open Plotly.NET.ImageExport
[<EntryPoint>]
let main argv =
let chromePathEnvOpt =
System.Environment.GetEnvironmentVariable("GOOGLE_CHROME")
|> Option.ofObj
let chromePathOpt: string option =
if argv.Length >= 1 then
Some (argv[0])
else
chromePathEnvOpt
match chromePathOpt with
| Some chromePath ->
PuppeteerSharpRendererOptions.localBrowserExecutablePath <- Some chromePath
let chart =
Chart.Point (
x = [ 0 .. 10 ],
y = [ 0 .. 10 ]
)
|> Chart.withTitle "Hello world!"
try
do chart |> Chart.savePNG("test")
with e ->
eprintfn "Error saving PNG: %s" e.Message
| None ->
eprintfn "Usage: <chrome-path> or define GOOLE_CHROME with path to binary"
0