Sub Process_Globals
Private BANano As BANano
End Sub
Sub AppStart (Form1 As Form, Args() As String)
BANano.Initialize("BANanoFrappe", "BANanoFrappe", DateTime.Now)
BANano.UseServiceWorker = False
BANano.HTML_NAME = "index.html"
BANano.Header.Title = "BANanoFrappe"
BANano.Header.AddJavascriptFile("https://cdn.jsdelivr.net/npm/frappe-charts@1.1.0/dist/frappe-charts.min.iife.js")
' ###
BANano.JAVASCRIPT_NAME = "app.js"
BANano.Build("C:\inetpub\wwwroot\BANano\") ' <- adjust to your needs!
ExitApplication
End Sub
Sub BANanoFrappe_Ready()
Dim HTML As String = $"
<div id="chart" style="width:800px"></div>
"$
BANano.GetElement("body").Append(HTML)
' ###
Dim ChartData As Map = CreateMap()
Dim Labels As List
Labels.Initialize
Labels.AddAll(Array As String("12am-3am", "3am-6pm", "6am-9am", "9am-12am", "12pm-3pm", "3pm-6pm", "6pm-9pm", "9am-12am"))
ChartData.Put("labels", Labels)
Dim DataSets As List
DataSets.Initialize
DataSets.Add(CreateMap("name": "Some Data", "type": "bar", "values": Array As Int(25, 40, 30, 35, 8, 52, 17, -4)))
DataSets.Add(CreateMap("name": "Another Set", "type": "line", "values": Array As Int(25, 50, -10, 15, 18, 32, 27, 14)))
ChartData.Put("datasets", DataSets)
Dim Chart As BANanoObject
Chart.Initialize2("frappe.Chart", Array("#chart", CreateMap("title" : "My Awesome Chart", _
"data" : ChartData, _
"type" : "axis-mixed", _
"colors" : Array("#7cd6fd", "#743ee2"), _
"height" : "600")))
End Sub