question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Buggy tick marks when large gaps in time

See original GitHub issue

Expected Behavior

I use type: 'time' and distribution: 'series' as options for an x-axis (options.scales.xAxes) in a line chart. I then add data of the following type: {t: new Date( ... ), y: ... }, where there is a gap in time (see pic below). I expect the tick marks to look nice at this point.

Current Behavior

This is how the tick marks looks as of now, they get smashed. image

Possible Solution

A possible solution proposed by @benmccann when discussing this is to use eg. autoSkip:true, and autoSkipPadding:75 as tick configuration for the axis (see in docs ). This however requires you to specify a certain padding (75 in example).

To solve this specifying a configuration as above could be to not have tick marks being drawn when there is no data, or have the auto-tick-thing consider possible large gaps in time of data that don’t need tick marks.

Steps to Reproduce (for bugs)

See JS Bin here.

Context

I have data points coming from a specific time stamp that I want to show. The data sometimes is of a format where there are lots of data points separated by the same small time-delta, eg. 10 ms. Then there is a gap of say 3 hours, and after that more data in the same way.

Environment

  • Chart.js version: CDN 2.8.0, Chart.js/2.8.0/Chart.bundle.min.js.
  • Browser name and version: Tried on Safari and Chrome.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
benmccanncommented, Aug 2, 2019

Thanks for the detailed report @jacobsorme. I have a PR that fixes this ready on my local machine, but it depends on https://github.com/chartjs/Chart.js/pull/6362 and https://github.com/chartjs/Chart.js/pull/6355, so I’m hoping folks can review those first and then I’ll send the PR for the bug fix

0reactions
kurklecommented, Jan 21, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get rid of large gaps in text in MS Word - Super User
Click anywhere on the page that has the gap. · Go to "Page Layout" tab · click on the lower right corner of...
Read more >
Why resume gaps aren't a big deal anymore | CNN Business
Career gaps on resumes have long been seen as red flags to some recruiters and hiring managers. Sometimes there is a concern that...
Read more >
Crop Marks Unstable or Buggy when printing Artboards with N ...
Under Bleed and Marks, I check "Include Printer Marks", "Include Crop Marks", and "Edge Only". There's no red alerts to sizing issues. All ......
Read more >
Prams and strollers: safety guide | Raising Children Network
Make sure there are no gaps that could trap your child's head, arms, legs or fingers. Ensure your pram or stroller has a...
Read more >
Scooter How-To : GY6 Valve Adjustment (Also For Buggy + Kart)
How to adjust the valves on a GY6 engine, common in scooters and go-karts.At the time of the video, I was using 0.004"/0.005"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found