Closed mcash95 closed 7 months ago
`@page "/graph" <ApexChart TItem="MyData" Title="Sample Data">
<ApexPointSeries TItem="MyData" Items="Data" Name="Net Profit" SeriesType="SeriesType.Bar" XValue="e => e.Category" YValue="e=> e.NetProfit" /> <ApexPointSeries TItem="MyData" Items="Data" Name="Revenue" SeriesType="SeriesType.Bar" XValue="e => e.Category" YValue="e=> e.Revenue" />
@code { private List Data { get; set; } = new(); protected override void OnInitialized() { Data.Add(new MyData { Category = "Jan", NetProfit = 12, Revenue = 33 }); Data.Add(new MyData { Category = "Feb", NetProfit = 43, Revenue = 42 }); Data.Add(new MyData { Category = "Mar", NetProfit = 112, Revenue = 23 }); }
public class MyData { public string Category { get; set; } public int NetProfit { get; set; } public int Revenue { get; set; } }
}`
this does not graph when the application is run. Any help you could provide would be appreciated.
I am running on .net 8 Blazor and i have both calls to interactive server in the program.cs file.
Thank you!
`@page "/graph" <ApexChart TItem="MyData" Title="Sample Data">
@code { private List Data { get; set; } = new();
protected override void OnInitialized()
{
Data.Add(new MyData { Category = "Jan", NetProfit = 12, Revenue = 33 });
Data.Add(new MyData { Category = "Feb", NetProfit = 43, Revenue = 42 });
Data.Add(new MyData { Category = "Mar", NetProfit = 112, Revenue = 23 });
}
}`
this does not graph when the application is run. Any help you could provide would be appreciated.
I am running on .net 8 Blazor and i have both calls to interactive server in the program.cs file.
Thank you!