apexcharts / Blazor-ApexCharts

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

XAxis text cannot be displayed for e.g.: "InvalidFile", "InvalidFileName", "Invalid", "InvalidMessageLength", ... #406

Closed IgMRe closed 5 months ago

IgMRe commented 6 months ago

XAxis text cannot be displayed for e.g.: "InvalidFile", "Invalid", ...

<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" />
</ApexChart>

@code { private List Data { get; set; } = new(); protected override void OnInitialized() { Data.Add(new MyData { Category = "TEST", NetProfit = 12, Revenue = 33 }); Data.Add(new MyData { Category = "Invalid", NetProfit = 43, Revenue = 42 }); // Text is not displayed Data.Add(new MyData { Category = "InvalidFile", NetProfit = 112, Revenue = 23 }); // Text is not displayed }

public class MyData
{
    public string Category { get; set; }
    public int NetProfit { get; set; }
    public int Revenue { get; set; }
}

}

joadan commented 6 months ago

Hi, Looks like apexcharts.js strips it off, please check here https://github.com/apexcharts/apexcharts.js/blob/52b6fc4bbc8cdafd81aa17ea4d9e5fe14c4a5a21/src/modules/axes/AxesUtils.js#L100

Please create an issue in the apexcharts.js repo if you want to continue the discussion. Thank you

Regards Joakim

joadan commented 6 months ago

Fixed in version 3.1