I have the following data structures in my app:
public class MetricValue
{
public DateTime TimeStamp { get; set; }
public double Average
}
public class CustomMetrics
{
public string ResourceName { get; set; }
public List<MetricValue> Metrics { get; set; }
}
This is the Action that returns the data for the chart in the razor view:
public async Task<IActionResult> GetAllDatabasesDTUPercentages()
{
List<CustomMetrics> data = ...
return Json(data);
}
I have been reading through the demos and documentation and samples on Github but I have no idea how to configure the chart in the razor view. Most examples have the data come through the page Model or an object with known properties as series.
The ResourceName should be the series name and I should see a series for each CustomMetrics object in the JSON data.
Any help would be appreciated.