apexcharts / Blazor-ApexCharts

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

XAxis labels for Line Chart when Type is DateTime #448

Open vsia7 opened 2 months ago

vsia7 commented 2 months ago

When type is DateTime, currently the line chart picks its own XAxis labels, from within the date range of the data. Labels do not neccessarily represent the real data points shown on the chart. For example if five Dates are shows on the Xaxis like 31/12/2023, 31/01/2024, 29/02/2024, 31/03/2024 and 29/04/2024, the chart looks like this:

image

This is misleading as none of the labels apart from 31/12/2023, are dates from real data points.

Is there any way to change this behaviour so the chart selects the labels from the dates provided in the data?

joadan commented 2 months ago

Hi,

I guess you could change the type to "Category"

vsia7 commented 2 months ago

Datetime has the advantage that I don't need to set the tick amount and the chart will automatically sample the data and show a sensible number of items on the axia

joadan commented 2 months ago

I'm sorry but I not aware of any other option. But please check out apexcharts.js documentation, maybe there is something available.