I'm trying to plot a line chart with a description, using the first method identified in https://plotly.net/00_2_display-options.html.
While the code runs, and the chart is correctly plotted, I can't see the description.
Here's the code block:
let description1 =
ChartDescription.create "Cumulative Growth of Market and HmL Factors" ""
Chart.combine(
[Chart.Line(
hmlGrowth,
Name="Hml")
Chart.Line(
marketGrowth,
Name="Mkt")
|> Chart.withDescription(description1)
|> Chart.withYAxisStyle (AxisType = StyleParam.AxisType.Log)
|> Chart.withXAxisStyle("Date")
]
)
If I add |> Chart.show I get a compilation error, perhaps because I'm using a Notebook.
Any help is greatly appreciated.
EDIT: managed to get in touch with the authors, should be sorted. https://github.com/plotly/Plotly.NET/issues/281
This works if you run code in F# Interactive and display it using
Chart.show
, but it does not work in .NET Interactive. When usingChart.show
, the description is added below the chart as ordinary HTML block, so I suspect the formatter for .NET Interactive just somhow ignores this part. I think this is a bug and it would be good to report & fix this.As a workaround, it seems that you can post-process the HTML generated for charts and add whatever additional code you need by getting the HTML and then returning it using the
HTML
helper. For example: