Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detach x axis from label time #275

Merged

Conversation

pwoltschk
Copy link
Contributor

Issue: #189

As an addition to the previous commit: To improve the X-axis display, I have separated it from the actual data points so that we always get the 1st day of the respective period displayed evenly in the year or month display. as is typical for stock charts, for example.

1. Set up time axis: The x-axis has been set to the time type in order to display date values correctly.
2. Adjust data points: Changed the parseDataSet method so that each data point contains an object with x (date) and y (value).
3. Configure ticks: The ticks settings provide automatic adjustment and limitation of the tick count to ensure clarity.
4. Formatting of the axes: Depending on the period (day, month, year) the display formats of the x-axis are dynamically adjusted.

Results:

Nuget10Year
properly displaying years in the beginning of each on the x axis

nuget2years
properly displaying monts in the beginning of each on the x axis

@bruno-garcia bruno-garcia merged commit 5b50131 into dotnet:main Nov 22, 2024
1 of 2 checks passed
@bruno-garcia
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants