{"action":"created","issue":{"url":"https://api.github.com/repos/JesperLekland/react-native-svg-charts/issues/46","repository_url":"https://api.github.com/repos/JesperLekland/react-native-svg-charts","labels_url":"https://api.github.com/repos/JesperLekland/react-native-svg-charts/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/JesperLekland/react-native-svg-charts/issues/46/comments","events_url":"https://api.github.com/repos/JesperLekland/react-native-svg-charts/issues/46/events","html_url":"https://github.com/JesperLekland/react-native-svg-charts/issues/46","id":296346134,"number":46,"title":"Support for data of different length in StackedAreaChart?","user":{"login":"Amnesthesia","id":3265008,"avatar_url":"https://avatars0.githubusercontent.com/u/3265008?v=4","gravatar_id":"","url":"https://api.github.com/users/Amnesthesia","html_url":"https://github.com/Amnesthesia","followers_url":"https://api.github.com/users/Amnesthesia/followers","following_url":"https://api.github.com/users/Amnesthesia/following{/other_user}","gists_url":"https://api.github.com/users/Amnesthesia/gists{/gist_id}","starred_url":"https://api.github.com/users/Amnesthesia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Amnesthesia/subscriptions","organizations_url":"https://api.github.com/users/Amnesthesia/orgs","repos_url":"https://api.github.com/users/Amnesthesia/repos","events_url":"https://api.github.com/users/Amnesthesia/events{/privacy}","received_events_url":"https://api.github.com/users/Amnesthesia/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-02-12T11:40:47Z","updated_at":"2018-02-13T14:15:49Z","closed_at":"2018-02-12T20:55:22Z","author_association":"NONE","body":"### What is the problem?\r\nStackedAreaChart 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.\r\n\r\nFor example, I have one chart with data points + timestamps, and I want to display this along with another set of datapoints with different timestamps. \r\n\r\nOne 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.\r\n\r\nCould StackedAreaChart support datasets of different length?\r\n\r\nLets say I want to show amount of page visits for a page, in correlation with how many times a topic is mentioned on Twitter:\r\n\r\n```javascript\r\n// Page visits per hour\r\nconst pageVisits = [\r\n  { visits: 149, timestamp: 1518388122 },\r\n  { visits: 123, timestamp: 1518391722 },\r\n  { visits: 180, timestamp: 1518395322 },\r\n  { visits: 190, timestamp: 1518398922 },\r\n  { visits: 430, timestamp: 1518402502 },\r\n  { visits: 614, timestamp: 1518406522 },\r\n  { visits: 590, timestamp: 1518409722 },\r\n  { visits: 301, timestamp: 1518413322 },\r\n  { visits: 159, timestamp: 1518416922 },\r\n  { visits: 140, timestamp: 1518420522 },\r\n]\r\n\r\n// Mentions for a topic on Twitter\r\nconst mentions = [\r\n  { mentions: 3, timestamp: 1518389240 },\r\n  { mentions: 2, timestamp: 1518394852 },\r\n  { mentions: 3, timestamp: 1518398495 },\r\n  { mentions: 45, timestamp: 1518402853 },\r\n  { mentions: 87, timestamp: 1518405495 },\r\n  { mentions: 120, timestamp: 1518408928 },\r\n  { mentions: 90, timestamp: 15184135032 }\r\n]\r\n```\r\n\r\nWould it be possible to show two charts with different datapoints but along the same \"timeline\" on top of each other?\r\n\r\n\r\n### What platform?\r\n\r\n* [X] iOS <!-- specific os version ? -->\r\n* [X] Android <!-- specific os version ? -->\r\n"},"comment":{"url":"https://api.github.com/repos/JesperLekland/react-native-svg-charts/issues/comments/365278826","html_url":"https://github.com/JesperLekland/react-native-svg-charts/issues/46#issuecomment-365278826","issue_url":"https://api.github.com/repos/JesperLekland/react-native-svg-charts/issues/46","id":365278826,"user":{"login":"Amnesthesia","id":3265008,"avatar_url":"https://avatars0.githubusercontent.com/u/3265008?v=4","gravatar_id":"","url":"https://api.github.com/users/Amnesthesia","html_url":"https://github.com/Amnesthesia","followers_url":"https://api.github.com/users/Amnesthesia/followers","following_url":"https://api.github.com/users/Amnesthesia/following{/other_user}","gists_url":"https://api.github.com/users/Amnesthesia/gists{/gist_id}","starred_url":"https://api.github.com/users/Amnesthesia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Amnesthesia/subscriptions","organizations_url":"https://api.github.com/users/Amnesthesia/orgs","repos_url":"https://api.github.com/users/Amnesthesia/repos","events_url":"https://api.github.com/users/Amnesthesia/events{/privacy}","received_events_url":"https://api.github.com/users/Amnesthesia/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T14:15:49Z","updated_at":"2018-02-13T14:15:49Z","author_association":"NONE","body":"For my usecase, they already do share the same domain (e.g displaying data for a month, or the past year, etc) but each dataset has different points (e.g when displaying data for January 2018, one line may have points for the 3rd, 5th and 20th and another line may have points for the 5th, 6th and 18th). \r\n\r\nThat's awesome though! Looking forward for 3.0 — excited about partial charts as well! :-) "}}
{"actor":{"display_login":"Amnesthesia"}}