apexcharts / Blazor-ApexCharts

A blazor wrapper for ApexCharts.js
https://apexcharts.github.io/Blazor-ApexCharts
MIT License
788 stars 91 forks source link

Example code does not graph #385

Closed mcash95 closed 7 months ago

mcash95 commented 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!