Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News Introducing XPlot, a Chart Generation Library for F#

Introducing XPlot, a Chart Generation Library for F#


XPlot is a cross-platform data visualization package for F# powered by JavaScript charting libraries Google Charts and Plotly. The XPlot library can be used interactively from F# Interactive, but charts can also be embedded in F# applications and in HTML reports.

XPlot acts as a F# wrapper around Javascript libraries. Using the API to generate a chart using Google Charts or Plotly as a provider, XPlot produces Html and Javascript code.

XPlot charts can be created dynamically and rendered in a web application.  For example, this code produces a bar chart displaying statuses with their respective occurrence:

open XPlot.GoogleCharts

let statusCount () =
  let series = [("Open",23); ("In Progress",5); ("Resolved", 58); ("Closed",5)]

  let options =
      Options(title = "Status", orientation = "horizontal")

  if series |> Seq.isEmpty then "no data" else
      let chart = 
        |> Chart.Bar
        |> Chart.WithOptions options
        |> Chart.WithLabels ["Count"]

The html output can then be embedded in a web application. The code above would produce this chart:

The charts generated by XPlot can be rendered from an F# application, but they can also be used from C#. This means a web or WPF application written in C# could use XPlot to generate a chart and then render the output.

Xplot is also available as part of the data science package FsLab. FsLab also contains librairies for data access and analysis, which can then be rendered using XPlot.


We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.