erossini / BlazorChartjs

Creates beautiful charts in Blazor using Chart.js. Library for NET6, NET7 and NET8. Source code and demo available.
https://www.puresourcecode.com/dotnet/blazor/blazor-component-for-chartjs/
MIT License
120 stars 44 forks source link

Support for Time Cartesian Axis #32

Open poulsenj opened 1 year ago

poulsenj commented 1 year ago

Feature request for handling of large data series where x value is a DateTime. Requires moment.js. Example: https://codepen.io/toxy1337/pen/rQRqrw

erossini commented 1 year ago

Could you change your code using ChartJs 4.1.0 please?

poulsenj commented 1 year ago

I added an example using Chart.js 4.1.0 ( and date.fns) here: https://codepen.io/poulsenj/pen/ZEjXNJm

poulsenj commented 1 year ago

Added another Chart.js 4.1.0 example using Javascript dates instead of strings. You can then disable Chart.js parsing date strings and get better performance with large data sets. https://codepen.io/poulsenj/pen/vYaewQx

erossini commented 1 year ago

Good thank you. I'll have a look and let you know when the implementation is done.

erossini commented 7 months ago

Hey, with the latest version of the component, now you can add time axis. Let me know if it is working for you. Enrico

poulsenj commented 6 months ago

Hi,

Commit a2961e7 implementing Time Cartesian Axis has new struct Enums.TimeUnit, two new classes Models.Common.AxesTime/Models.Common.AxesTimeFormats, and an addition of property AxesTime to class Models.Common.Axis. The current release has those changes, except for the addition of property AxesTime to class Models.Common.Axis. So how is AxesTime brought into play?

Johannes

On Mon, Apr 22, 2024 at 4:21 PM Enrico Rossini @.***> wrote:

Hey, with the latest version of the component, now you can add time axis. Let me know if it is working for you. Enrico

— Reply to this email directly, view it on GitHub https://github.com/erossini/BlazorChartjs/issues/32#issuecomment-2069633402, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCSNGVYALNGNDM6Z45G2T3Y6UMIFAVCNFSM6AAAAAASX42NRCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRZGYZTGNBQGI . You are receiving this because you authored the thread.Message ID: @.***>

poulsenj commented 6 months ago

I got it working by adding property AxesTime to class Models.Common.Axis and adding file wwwroot/lib/Chart.js/moment.js as the chartjs-adapter-moment.js is part of the package, but moment.js itself is not. So moment.js should either be packed as well or included in the users project.

NilkOne commented 2 days ago

Hi @erossini, why did you delete AxesTime property in Axis.cs ?

in this commit : Fix conflicts in the PR on Apr 22 2024