fslaborg / fslaborg/XPlot

GoogleCharts: order of WithOptions causes issues rendering chart

Open
#67 0 comments 0 reactions 0 assignees View on GitHub
Area: API Area: google charts enhancement help wanted
Dominant language
F#
Stars
289
Forks
70
PR merge metrics
No merged PRs in 30d

Description

When creating a Chart using XPlot.GoogleCharts, if `Chart.WithOptions` is called after some other chart properties are set, these properties get ignored. If the call is made before them, they are rendered properly.

Expected behavior: order of the calls should not matter
Actual behavior: order of the calls causes some settings to be ignored.

Reproduction: .fsx script, Windows, .net45
```
#I "./packages/"
#r "Google.DataTable.Net.Wrapper/lib/Google.DataTable.Net.Wrapper.dll"
#r "XPlot.GoogleCharts/lib/net45/XPlot.GoogleCharts.dll"

open XPlot.GoogleCharts

let options = Configuration.Options()
options.lineWidth <- 2

[ 1;2;3;4;5;]
|> Chart.Line
|> Chart.WithTitle "The Title" // line A
|> Chart.WithOptions options // line B
|> Chart.Show
```

If the order of line A and line B is swapped, the Chart title is not rendered. The same thing happens with other calls, ex: `Chart.WithXTitle`

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.