Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# chart control change legend text

Tags:

.net

f#

mschart

when using F# chart control library, how can I specify the text of the legend? for instance:

    FSharpChart.Line [ for f in 0.0 .. 0.1 .. 10.0 -> cos f ] 
   |> FSharpChart.WithLegend()

shows a legend with text "GenericChart_Series_1". How can I change the text?

like image 471
ahala Avatar asked Jun 03 '11 02:06

ahala


1 Answers

You can specify the legend using the Name property of the chart object. The property can be set when calling the Line member:

FSharpChart.Line([ for f in 0.0 .. 0.1 .. 10.0 -> cos f ], Name = "Cos")
|> FSharpChart.WithLegend()
like image 100
Tomas Petricek Avatar answered Nov 07 '22 04:11

Tomas Petricek