Looking to generate a flexible array that can be converted into a JSON array for visualization with Morris charts. The usual approach in VB.NET is as follows:
Dim xArray(2)
xArray(0) = New With {Key .TradingDay = "Day1", .Seller1 = 1500, .Seller2 = 1600}
xArray(1) = New With {Key .TradingDay = "Day2", .Seller1 = 2300, .Seller2 = 1850}
xArray(2) = New With {Key .TradingDay = "Day3", .Seller1 = 4970, .Seller2 = 3560}
However, the challenge here lies in the dynamic nature of the Sellers involved. Clients should have the choice to select sellers from a listbox. In such cases, the setup could look like this:
Dim xArray(2)
xArray(0) = New With {Key .TradingDay = "Day1", .Seller2 = 1600, .Seller3 = 2550, .Seller4 = 3600}
xArray(1) = New With {Key .TradingDay = "Day2", .Seller2 = 1850, .Seller3 = 890, .Seller4 = 3456}
xArray(2) = New With {Key .TradingDay = "Day3", .Seller2 = 3560, .Seller3 = 10890, .Seller4 = 2850}
Is there a method to construct a dynamic array and convert it into a JSON format successfully?