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.

Treat Line x values as linear scale? (Timeline functionality)

See original GitHub issue

It may be that I haven’t figured out the proper combo of options and data setup, but is there a way when using @nivo/line to treat the x-axis as a number line, where the x values are placed from low to high on the axis corresponding to their actual position, instead of being equally distributed?

The use case here is rendering a contiguous line chart with the x-axis being time with irregular values. So far, the only solution I’ve come up with is filling in my data values with copies for all missing timestamps, but that gets difficult when values don’t land evenly.

(For reference, Chartist has a decent generic implementation of this with fixedscaleaxis.js)

Thanks for the amazing library @plouc!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
plouccommented, Aug 30, 2018

Implemented via #275

1reaction
plouccommented, Jun 7, 2018

Hi @jlyman,

There’s no support for continuous scales on the line package, I’ve previously tried to add this functionality but without success for now, my major problem was to be able to provide the same defaults/easy to use components without introducing too much of setup.

Line supports stacked lines via slice selection (to be able to provide the stacked tooltip for example), I must find a way to provide more low level components to cover such cases or rethink the whole package.

The scatterplot package partially supports this, but I’ve coded it after the line package, so it does not provides functionality depending on a specific scale type.

I’m very concerned about this feature, it’s a limitation for many chart types, I’m currently working on improving legends support for all components, my next big thing on the project might be to fix this, probably with a bunch of BC breaks though 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Line chart options | Looker - Google Cloud
Overview of visualization menu options for line charts. ... You can specify how the x-axis scale is calculated and displayed. Automatic Based on...
Read more >
How to Chart Time Series: Linear vs. Logarithmic Scale - Winton
Time series are most commonly plotted on a linear scale. However logarithmic, or log, scale gives equal visual weight to equal relative ...
Read more >
Line chart reference - Looker Studio Help - Google Support
Line charts based on Date or Date & Time dimensions will display gaps in the X-axis if those fields are missing data for...
Read more >
Line chart | nivo
Line chart with stacking ability. Given an array of data series having an id and a nested array of points (with x, y...
Read more >
Line Graphs and Irregular Intervals - Perceptual Edge
Using a line to connect values along unequal intervals of time or to connect ... X-axis is not quantitative in nature, and thus...
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