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

xAxis when using Timeseries inconsistent behavior #80

Closed
Carniatto opened this issue Sep 6, 2018 · 7 comments
Closed

xAxis when using Timeseries inconsistent behavior #80

Carniatto opened this issue Sep 6, 2018 · 7 comments

Comments

@Carniatto
Copy link

Carniatto commented Sep 6, 2018

I've been using ApexCharts with timeseries and Line charts. I encountered three weird behaviors regarding the way the xAxis is drawn:

  • The first and last data point are often cropped on the chart:
    screen shot 2018-09-06 at 15 32 24

  • When only two days are in the series the xAxis has hours and days.

screen shot 2018-09-06 at 15 35 03

https://codepen.io/Carniatto/pen/LJzbOx
  • Sometimes the format for month gets mixed up with year

screen shot 2018-09-06 at 15 27 33

https://codepen.io/Carniatto/pen/EewNLy
@Carniatto Carniatto changed the title Timeseries mixing hours with dates xAxis when using Timeseries inconsistent behavior Sep 6, 2018
@junedchhipa
Copy link
Contributor

Hi @Carniatto

Actually, this is the way I have kept the x-axis tick generation to differentiate the days and hours when the difference is more than 1 day.

In certain cases, a user may not like this and would just prefer a single format - in your case: just the hours.

So, as suggested by you in another thread, I am going to provide the raw date-time value in the formatter function as a parameter where the user can use whatever suits them - no default behaviors.

Thanks for reporting @Carniatto

@Carniatto
Copy link
Author

Carniatto commented Sep 6, 2018

Thank you @junedchhipa. Can I suggest the option to add padding in the beginning and the end so all the points are contained inside the Chart? avoiding the first problem?

@junedchhipa
Copy link
Contributor

@Carniatto Ah! I didn't see the edited comment.
So, the cropped dataPoints issue was fixed in the apexcharts@1.3.20. May I ask which version of ApexCharts you are testing on?

@Carniatto
Copy link
Author

Carniatto commented Sep 6, 2018

@junedchhipa I'm using version: 1.3.12. I have another question: If I set type: 'datetime' the number of ticks is automatically determined by the library right?

@junedchhipa
Copy link
Contributor

Yes, you are right - Currently, you have no control over the number of ticks when type = datetime

@Carniatto
Copy link
Author

@junedchhipa thanks for the quick response, let me know when you shipp the raw datetime. I'd like to contribute to the repo like add download as png or something like this. Let me know if I can open a PR.

@junedchhipa
Copy link
Contributor

@Carniatto I appreciate your willingness to make the library better.
I will soon create a simple contributing guideline.
For now, just create a PR with "feature/featureName" branch.
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

No branches or pull requests

2 participants