Sub BuildSDUI5ApexChart(component As Map)
Try
Dim sComponentName As String = component.Get("componentname")
Dim thisComp As SDUI5ApexChart
thisComp.Initialize(Me, sComponentName, sComponentName)
thisComp.SetProperties(component)
BANano.Await(thisComp.AddComponent)
'area|bar|column|donut|line|pie|polarArea|radar|radialBar|rangeArea|scatter
Dim sChartType As String = component.Get("TypeOf")
Select Case sChartType
Case "line"
thisComp.Clear
thisComp.AddCategories(Array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"))
thisComp.AddSeries("Daily Visitors", "#008FFB", Array(1200, 1350, 1180, 1420, 1680, 1890, 2100))
thisComp.Refresh
Case "area"
thisComp.clear
thisComp.addCategories(Array("Jan","Feb","Mar","Apr","May","Jun","Jul"))
thisComp.addSeries("Organic", "#008FFB", Array(44,55,41,67,22,43,21))
thisComp.addSeries("Direct", "#00E396", Array(13,23,20,8,13,27,33))
thisComp.addSeries("Referral", "#FEB019", Array(11,17,15,15,21,14,22))
thisComp.refresh
Case "bar"
thisComp.clear
thisComp.addCategories(Array("Jan","Feb","Mar","Apr","May","Jun"))
thisComp.addSeries("Revenue", "#FF4560", Array(1200,1500,1800,2200,1900,2500))
thisComp.refresh
Case "column"
thisComp.clear
thisComp.addCategories(Array("Jan","Feb","Mar","Apr","May"))
thisComp.addSeries("Revenue", "#008FFB", Array(100,120,140,160,180))
thisComp.addSeries("Target", "#00E396", Array(110,130,135,155,175))
thisComp.refresh
Case "donut"
thisComp.clear
thisComp.addSeries("Chrome","#008FFB",65)
thisComp.addSeries("Firefox","#00E396",20)
thisComp.addSeries("Safari","#FEB019",10)
thisComp.addSeries("Other","#FF4560",5)
Dim options As Map = CreateMap()
app.UI.PutRecursive(options, "stroke.width", 6)
app.UI.PutRecursive(options, "stroke.colors", Array("#fff"))
app.UI.PutRecursive(options, "stroke.lineCap", "round")
thisComp.UpdateOptions(options)
thisComp.refresh
Case "pie"
thisComp.clear
thisComp.addSeries("Desktop", "#008FFB", 44)
thisComp.addSeries("Mobile", "#00E396", 23)
thisComp.addSeries("Tablet", "#FEB019", 33)
Dim options As Map = CreateMap()
app.UI.PutRecursive(options, "stroke.width", 6)
app.UI.PutRecursive(options, "stroke.colors", Array("#fff"))
app.UI.PutRecursive(options, "stroke.lineCap", "round")
app.UI.PutRecursive(options, "plotOptions.pie.dataLabels.offset", 0)
app.UI.PutRecursive(options, "plotOptions.pie.dataLabels.style.colors", Array("#fff"))
thisComp.UpdateOptions(options)
thisComp.refresh
Case "polarArea"
thisComp.clear
thisComp.addSeries("House A", "#FF7A59", 44)
thisComp.addSeries("House B", "#FFD166", 20)
thisComp.addSeries("House C", "#06D6A0", 13)
thisComp.addSeries("House D", "#4CC9F0", 43)
thisComp.addSeries("House E", "#7209B7", 27)
thisComp.refresh
Case "radar"
thisComp.clear
thisComp.addCategories(Array("Strength","Speed","Endurance","Agility","Technique","Luck"))
thisComp.addSeries("Car 1", "#AA00FF", Array(80,50,30,40,100,20))
thisComp.refresh
Case "radialBar"
thisComp.clear
thisComp.addSeries("Progress", "#008FFB", 70)
thisComp.addSeries("Score", "#00E396", 80)
thisComp.addSeries("Rating", "#FEB019", 90)
thisComp.refresh
Case "rangeArea"
Dim xSeries As String = "New York Temperature"
thisComp.clear
thisComp.addSeriesColor(xSeries, "#008FFB")
thisComp.addSeriesPoint(xSeries, "Jan", Array(-2, 4))
thisComp.addSeriesPoint(xSeries, "Feb", Array(-1, 6))
thisComp.addSeriesPoint(xSeries, "Mar", Array(3, 10))
thisComp.addSeriesPoint(xSeries, "Apr", Array(8, 16))
thisComp.addSeriesPoint(xSeries, "May", Array(13, 22))
thisComp.addSeriesPoint(xSeries, "Jun", Array(18, 26))
thisComp.addSeriesPoint(xSeries, "Jul", Array(21, 29))
thisComp.addSeriesPoint(xSeries, "Aug", Array(21, 28))
thisComp.addSeriesPoint(xSeries, "Sep", Array(17, 24))
thisComp.addSeriesPoint(xSeries, "Oct", Array(11, 18))
thisComp.addSeriesPoint(xSeries, "Nov", Array(6, 12))
thisComp.addSeriesPoint(xSeries, "Dec", Array(1, 7))
thisComp.Refresh
Case "scatter"
thisComp.clear
thisComp.addSeriesColor("Data Points", "#008FFB")
thisComp.addSeriesPoint("Data Points", 10, 20)
thisComp.addSeriesPoint("Data Points", 15, 25)
thisComp.addSeriesPoint("Data Points", 20, 30)
thisComp.addSeriesPoint("Data Points", 25, 35)
thisComp.addSeriesPoint("Data Points", 30, 40)
thisComp.refresh
End Select
Catch
End Try 'ignore
End Sub