J'utilise le graphique circulaire Chart.js et j'aimerais supprimer les lignes blanches entre les tranches. Quelqu'un pourrait-il me dire comment faire cela? Merci d'avance
Je n'ai rien vu dans la documentation.
<div class="pie-chart"> <div id="canvas-holder"> <canvas id="chart-area" width="250" height="250"/> </div> </div>
Configurez simplement les options pour que le graphique cache la ligne
segmentShowStroke: false
Quelque chose comme ça:
//create chart var ctx = document.getElementById("myChart").getContext("2d"); var data = [{ value: 300, color: "#F7464A", highlight: "#FF5A5E", label: "Red" }, { value: 50, color: "#46BFBD", highlight: "#5AD3D1", label: "Green" }, { value: 100, color: "#FDB45C", highlight: "#FFC870", label: "Yellow" }]; var options = { //Boolean - Whether we should show a stroke on each segment // set to false to hide the space/line between segments segmentShowStroke: false }; // For a pie chart var myPieChart = new Chart(ctx).Pie(data, options);
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js"></script> <canvas id="myChart" width="200" height="200"></canvas>
Dans [email protected] (n'a pas testé pour [email protected]):
const options = { elements: { arc: { borderWidth: 0 } } };
datasets: [ { label: "TeamB Score", data: [20, 35, 40, 60, 50], backgroundColor: [ "#FAEBD7", "#DCDCDC", "#E9967A", "#F5DEB3", "#9ACD32" ], borderColor: [ "#E9DAC6", "#CBCBCB", "#D88569", "#E4CDA2", "#89BC21" ], borderWidth: [1, 1, 1, 1, 1] } ]