I tried to use the solution that Tomas Petricek wrote on this website but not for a string but for an image. Unfortunately, it doesn't work. This is my code:
Model:
let ChartModelCumulativePerformance =
let numMths = 60
let trackOfDates numMths = firstDate.AddMonths(numMths)
let trackHF = [for x in 0 .. 59 ->(trackOfDates x, HFReturns.[x])]
let trackBchk = [for x in 0 .. 59 ->(trackOfDates x, BchkReturns.[x])]
Chart.Line(trackHF,Name="Hedge Fund") |> ignore
Chart.Line(trackBchk,Name="Benchmark") |> ignore
let myChart = Chart.Combine(
[Chart.Line(trackHF,Name="Hedge Fund")
Chart.Line(trackBchk,Name="Benchmark")])
myChart.CopyAsBitmap()
member this.CreateCumulativePerformanceGraph() = ChartModelCumulativePerformance
Controller:
let dataChart = res.CreateCumulativePerformanceGraph()
let (?<-) (viewData:ViewDataDictionary) (name:string) (value: Image) = viewData.Add(name, value)
this.ViewData?chartCumulative <- dataChart
this.View("HFAnalysis") :> ActionResult
View
<img src =@ViewBag.chartCumulative height="80" width="80"/ alt="" />
or
<img src =@ViewData["chartCumulative"] height="80" width="80"/ alt="" />
Otherwise, do you know another methodologies? Thank in advance for your help