Support for data of different length in StackedAreaChart?
See original GitHub issueWhat 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:
- Created 6 years ago
- Comments:16 (8 by maintainers)
Top GitHub Comments
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 š
You should be able to do what youāve described on the existing release though. Have you tried it?