XPlot icon indicating copy to clipboard operation
XPlot copied to clipboard

GoogleCharts: order of WithOptions causes issues rendering chart

Open mathias-brandewinder opened this issue 6 years ago • 0 comments

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

mathias-brandewinder avatar Jun 22 '18 19:06 mathias-brandewinder