fslaborg / fslaborg/XPlot

Chart.Line sometimes shows erroneous curves in the case of incomplete data

Open
#28 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
F#
Stars
289
Forks
70
PR merge metrics
No merged PRs in 30d

Description

[Cross-posting from https://github.com/fslaborg/FsLab/issues/108]

In the following code, the two plots look quite different:

```
#load "packages/FsLab/FsLab.fsx"

open Deedle
open FSharp.Data
open XPlot.GoogleCharts
open XPlot.GoogleCharts.Deedle

let wb = WorldBankData.GetDataContext()
let cz = wb.Countries. Czech Republic .Indicators
let eu = wb.Countries. European Union .Indicators
let czforest = series cz. Forest area (% of land area)
let euforest = series eu. Forest area (% of land area)

[ czforest.[1990 .. 1993]; euforest.[1990 .. 1993] ]
|> Chart.Line
|> Chart.WithOptions (Options(legend=Legend(position="bottom")))
|> Chart.WithLabels ["CZ"; "EU"]

[ euforest.[1990 .. 1993]; czforest.[1990 .. 1993] ]
|> Chart.Line
|> Chart.WithOptions (Options(legend=Legend(position="bottom")))
|> Chart.WithLabels ["EU"; "CZ"]
```

The difference seems to be due to missing data - there is no value for czforest.[1992]. My view is that the last version (interrupted curves) is the correct display of the data.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.