Customizations to charts persist unexpectedly
Motivated by http://stackoverflow.com/questions/31305580/fsharpchart-two-scales-on-same-graphic.
I assumed that "customizations" to chart objects were done in a non-mutating way, i.e. a fresh new chart was created with the specified customization, and the original was left unchanged.
But it seems that many customizations are "sticky," as if the original chart object has been mutated. This feels like a bug.
#load "../packages/FSharp.Charting.0.90.10/FSharp.Charting.fsx"
open FSharp.Charting
open System.Windows.Forms.DataVisualization.Charting
// displays, no title. good.
let chart =
[1..10]
|> List.map (fun n -> (n, n))
|> Chart.Line ;;
// displays, with title. good.
chart |> Chart.WithTitle(Text = "Test") ;;
// displays, *with* title. why?
chart ;;
Perhaps more clear:
let chart =
[1..10]
|> List.map (fun n -> (n, n))
|> Chart.Line
[chart |> Chart.WithTitle(Text = "ABC")
chart |> Chart.WithTitle(Text = "XYZ")]
|> Chart.Rows

Yeah ideally it would not be like this. It was just how it was originally implemented and I think it turns out simpler because an underlying mutable chart specification is used to hold all the configuration information.
My guess is it would be a lot of work to fix this given the very large size of the chart specification parameter space.