fslaborg / FSharp.Charting

Charting library suitable for interactive F# scripting
http://fslab.org/FSharp.Charting/
Other
216 stars 67 forks source link

Legend in case of using Name property #144

Open FoggyFinder opened 5 years ago

FoggyFinder commented 5 years ago

From documentation:

A legend is added automatically when names are used for data sets.

That's incorrect right now.

Probably because

let hasLegend = not (String.IsNullOrEmpty series.Name) || LegendEnabled.IsSome

series.Name is empty since #21

voronoipotato commented 5 years ago

https://github.com/fslaborg/FSharp.Charting/commit/dce9fecb8cdec724a768f7d1577769929f75cb60

does this check-in fix this issue?

FoggyFinder commented 5 years ago

@voronoipotato no.

Probably I wasn't clear enough.

https://github.com/fslaborg/FSharp.Charting/pull/22/commits/96e4f6c2ba4ced7ce4b11c8e7e671aa9854e644a

Name was set to a Chart, but legend's visibility still depends on name of a series.

let hasLegend = not (String.IsNullOrEmpty series.Name) || LegendEnabled.IsSome

So, I see two options here:

  1. Documentation is wrong
  2. hasLegend should check ch.Name instead of series.Name.