/* Already defined variable (Before the input) * * var chart_1_num_day = 5; * var chart_2_num_day = 15; * */ function getSyncScriptParams() { var scripts = document.getElementsByTagName('script'); var lastScript = scripts[scripts.length-1]; var scriptName = lastScript; return { url_progressionCharts : scriptName.getAttribute('data-url_progressionCharts'), }; } var url_progressionCharts = getSyncScriptParams().url_progressionCharts; function plot_top_graph(trendingName, init){ /**** Flot Pie Chart ****/ var tot_sum = 0; // used to detect elements placed in 'Other' pie's part var data_other = []; // used to detect elements placed in 'Other' pie's part var pie_threshold = 0.05 var options = { series: { pie: { show: true, radius: 3/5, combine: { color: '#999', threshold: pie_threshold }, label: { show: true, radius: 1, formatter: labelFormatter, background: { opacity: 0.5, color: '#000' } } } }, grid: { hoverable: true, clickable: true }, legend: { show: false } }; function labelFormatter(label, series) { return "