- Posts: 40
- Thank you received: 4
Ask the community, share ideas, and connect with other LimeSurvey users!
Si tu trouve un correctif : hésite pas à proposer ce correctif, c'est tout de même le meilleuir moyen …pberthol wrote: y'a t'il moyen d'avoir des infos sur l'origine du bug afin que je puisse créer temporairement un fix en attendant la version
corrigée ?
var $options = { tooltipTemplate: "<%if (label){%><%=label %>: <%}%><%= value + '%' %>", };
var $options = { tooltipTemplate: "<%if (label){%><%=label %>: <%}%><%= value %>", };
/** * This function load the graphs needing datas (pie chart, polar, Doughnut) */ function init_chart_js_graph_with_datas($type,$qid) { var canvasId = 'chartjs-'+$qid; var $canvas = document.getElementById(canvasId).getContext("2d"); var $canva = $('#'+canvasId); var $color = $canva.data('color'); var $statistics = statisticsData['quid'+$qid]; if($statistics == undefined) return; var $labels = $statistics.labels var $grawdata = $statistics.grawdata var $chartDef = new Array(); $('#legend-no-percent-'+$qid).hide(); $('#legend-percent-'+$qid).show(); $('#stat-no-answer-'+$qid).show(); $.each($labels, function($i, $label) { $colori = (parseInt($i)+$color); $chartDef[$i] = { value: $grawdata[$i], color:"rgba("+COLORS_FOR_SURVEY[$colori]+",0.6)", highlight: "rgba("+COLORS_FOR_SURVEY[$colori]+",0.9)", label: $label, }; }); var $options = { tooltipTemplate: "<%if (label){%><%=label %>: <%}%><%= value + '%' %>", }; if (typeof chartjs != "undefined") { if (typeof chartjs[$qid] != "undefined") { window.chartjs[$qid].destroy(); } } window.chartjs[$qid] = new Chart($canvas)[$type]( $chartDef, $options ); }
/** * This function load the graphs needing datas (pie chart, polar, Doughnut) */ function init_chart_js_graph_with_datas($type,$qid) { var canvasId = 'chartjs-'+$qid; var $canvas = document.getElementById(canvasId).getContext("2d"); var $canva = $('#'+canvasId); var $color = $canva.data('color'); var $statistics = statisticsData['quid'+$qid]; if($statistics == undefined) return; var $labels = $statistics.labels var $grawdata = $statistics.grawdata var $chartDef = new Array(); var max = 0; $('#legend-no-percent-'+$qid).hide(); $('#legend-percent-'+$qid).show(); $('#stat-no-answer-'+$qid).show(); $.each($labels, function($i, $label) { max = max + parseInt($grawdata[$i]); }); $.each($labels, function($i, $label) { $colori = (parseInt($i)+$color); $chartDef[$i] = { value: Math.floor(($grawdata[$i]/max)*100), color:"rgba("+COLORS_FOR_SURVEY[$colori]+",0.6)", highlight: "rgba("+COLORS_FOR_SURVEY[$colori]+",0.9)", label: $label, }; }); var $options = { tooltipTemplate: "<%if (label){%><%=label %>: <%}%><%= value + '%' %>", }; if (typeof chartjs != "undefined") { if (typeof chartjs[$qid] != "undefined") { window.chartjs[$qid].destroy(); } } window.chartjs[$qid] = new Chart($canvas)[$type]( $chartDef, $options ); }