I have tried your code and it seems to be working for me with no problem.

Are you sure you get the right (or any) data from the database? Also check the console in your browser. There might be something fishy going on on the client side, which hinders the rendering of the chart.

For reference the code I used:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.JQuery
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Highcharts

open Microsoft.FSharp.Data.TypeProviders

module Client =

    type dbSchema = SqlDataConnection<"ConnString">

    [<Rpc>]
    let nfData() = 
        let ctx = dbSchema.GetDataContext ()
        query { for a in ctx.Something do
                select (a.Integer)
                take 10 }
        |> Seq.toArray

    [<JavaScript>]
    [<Require(typeof<Resources.Highcharts>)>] 
    let Main () = 
        let jj = nfData() 
        Div [] |>! OnAfterRender (fun el -> 
            Highcharts.Create(JQuery.Of el.Dom, 
                HighchartsCfg(
                    Series = ( [| "Tokyo", jj |] |> Array.map (fun (c, d) -> SeriesCfg (Name = c, Data = As d)) ) 
                ) 
            ) |> ignore 
        )	
By on 12/29/2014 3:28 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper