Ich versuche, Etiketten zu meinem Balkendiagramm hinzuzufügen. Siehe JS Geige und Code unten. Wie würde ich meinen Code ändern, um Labels hinzuzufügen?Labels zu ChartsJS hinzufügen Balkendiagramm
http://jsfiddle.net/amwmedia/8kqvyhqv/
var myNewChart;
var data = [
{
value: 30,
label: "hello",
color: "#F7464A"
}, {
value: 50,
color: "#E2EAE9"
}, {
value: 100,
color: "#D4CCC5"
}, {
value: 40,
color: "#949FB1"
}, {
value: 100,
color: "#4D5360"
},
];
var options = {
animation: true,
animationEasing: 'easeInOutQuart',
animationSteps: 80,
multiTooltipTemplate: "<%= datasetLabel %> - <%= value %>"
};
var ctx = document.getElementById("myChart")
.getContext("2d");
myNewChart = new Chart(ctx).Doughnut(data, options);
Mögliches Duplikat von [Wie fügt man Beschriftungen in das Chart.js-Canvas-Plugin ein?] (http://StackOverflow.com/questions/16590301/how-to-add-labels-into chart-js-canvas-plugin) – nico
Es ist sicher ein Duplikat von [Wie man Kreisdiagrammdatenwerte jedes Slices in chart.js anzeigt] (http://stackoverflow.com/questions/33363373/how-to- display-pie-chart-daten-werte-von-jedem-slice-in-chart-js) – jordanwillis