I'm trying to create a radzen column chart using a list from a database. For example:
Class databaseItem()
{
public string CatagoryName { get; set; }
public double Amount { get; set; }
}
Instead of using this method from the column chart example:
DataItem[] revenue2023 = new DataItem[] {
new DataItem
{
Quarter = "Q1",
Revenue = 234000
},
new DataItem
{
Quarter = "Q2",
Revenue = 284000
}
}
I want to do something like this:
List<databaseItem> items = GetFromDatabase();
DataItem[] revenue2023 = new DataItem[] {
foreach (databaseItem item in items)
{
Quarter = item.CatagoryName,
Revenue = item.amount
}
}
Basically I want it to get the datapoints by running through a list instead of having to name each one separately. Is this possible? And if so how?