{"size": 515, "ext": "js", "max_stars_repo_path": "src/chart.js", "max_stars_repo_name": "lapakdigital/molang", "max_stars_repo_stars_event_min_datetime": "2019-02-22T11:01:18.000Z", "max_stars_repo_stars_event_max_datetime": "2020-03-26T06:46:39.000Z", "max_issues_repo_path": "src/chart.js", "max_issues_repo_name": "lapakdigital/molang", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/chart.js", "max_forks_repo_name": "lapakdigital/molang", "max_forks_repo_forks_event_min_datetime": "2019-04-01T08:37:30.000Z", "max_forks_repo_forks_event_max_datetime": "2020-04-30T10:30:12.000Z"}
{"max_stars_count": 10, "max_issues_count": null, "max_forks_count": 9, "avg_line_length": 24.5238095238, "max_line_length": 68, "alphanum_fraction": 0.5009708738}
const moment = require('moment');

const onlyUnique = (value, index, self) => { 
    return self.indexOf(value) === index;
}

module.exports = {
    genPoporingChartUrl: dataList => {

        const priceArray = dataList.map(v => v.price);
        const y = priceArray.filter(p => p !=0).reverse().join(',');

        return 'https://image-charts.com/chart?' + [
            `cht=ls`,
            `chd=a:${y}`,
            `chds=a`,
            `chs=350x180`,
            `chco=76A4FB`,
        ].join('&');
    }
}