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.

Support for data of different length in StackedAreaChart?

See original GitHub issue

What is the problem?

StackedAreaChart accepts an array of objects, in which all datapoints are specified by keys. I have a use-case where I have two separate ā€œtimelinesā€, where I want to show data from two data-sets that dont necessarily have the same length.

For example, I have one chart with data points + timestamps, and I want to display this along with another set of datapoints with different timestamps.

One solution would be to inject the second set into the first one based on the ā€œclosestā€ timestamp for each value, but this doesnā€™t seem like a good solution.

Could StackedAreaChart support datasets of different length?

Lets say I want to show amount of page visits for a page, in correlation with how many times a topic is mentioned on Twitter:

// Page visits per hour
const pageVisits = [
  { visits: 149, timestamp: 1518388122 },
  { visits: 123, timestamp: 1518391722 },
  { visits: 180, timestamp: 1518395322 },
  { visits: 190, timestamp: 1518398922 },
  { visits: 430, timestamp: 1518402502 },
  { visits: 614, timestamp: 1518406522 },
  { visits: 590, timestamp: 1518409722 },
  { visits: 301, timestamp: 1518413322 },
  { visits: 159, timestamp: 1518416922 },
  { visits: 140, timestamp: 1518420522 },
]

// Mentions for a topic on Twitter
const mentions = [
  { mentions: 3, timestamp: 1518389240 },
  { mentions: 2, timestamp: 1518394852 },
  { mentions: 3, timestamp: 1518398495 },
  { mentions: 45, timestamp: 1518402853 },
  { mentions: 87, timestamp: 1518405495 },
  { mentions: 120, timestamp: 1518408928 },
  { mentions: 90, timestamp: 15184135032 }
]

Would it be possible to show two charts with different datapoints but along the same ā€œtimelineā€ on top of each other?

What platform?

  • iOS
  • Android

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
JesperLeklandcommented, Feb 12, 2018

Haha, glad I can help šŸ˜„ Donā€™t forget to give it a star if you havenā€™t already. And if you want to contribute just create a PR and I will happily look at it šŸ˜Š

0reactions
JesperLeklandcommented, Feb 14, 2018

You should be able to do what youā€™ve described on the existing release though. Have you tried it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Complete Guide to Stacked Bar Charts | Tutorial by Chartio
Stacked bar charts extend the standard bar chart by dividing each bar into multiple subcategories. Learn how to best use this chart type...
Read more >
Stacked area chart
Stacked area charts compare historical trends or changes by showing the proportion of the total that each category represents at any given point...
Read more >
How to Create a Stacked Area Chart in Excel? - PPCexpo
A Stacked Area Chart is one of the best-suited visualization designs you can use to display the trend of key variables in your...
Read more >
A Guide to Area Charts - Wyn Enterprise - GrapeCity
A stacked area chart depicts data series as stacked regions with different colors that help perform comparisons between multiple series forĀ ...
Read more >
Tableau 201: How to Make a Stacked Area Chart - Evolytics
Expert data viz tips about making stacked area charts in a Tableau ... A stacked area chart 'stacks' trends on top of each...
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