Created
April 13, 2020 09:11
-
-
Save miyamae/dd674b5f43da726662b9d933147a866a to your computer and use it in GitHub Desktop.
Google Charts用に配列を合成
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const mergeLineChartData = (head, dst, src) => { | |
| dst[0].push(head) | |
| let existed = false | |
| for (const s of src) { | |
| existed = false | |
| for (const d of dst) { | |
| if (d[0] === s[0]) { | |
| d.push(s[1]) | |
| existed = true | |
| } | |
| } | |
| if (!existed) { | |
| dst.push(s) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment