I\'m creating a fairly simple pie chart with Chart.JS like so:
var data = {
labels: [
\"Bananas (18%)\",
\"Lettuce, Romaine (14%)\",
You have to turn the default legend off in the options first with:
legend: {
display: false
},
Also your id
selector for your legend was wrong. Fiddle.
Wrap the chart in the HTML CSSdiv
and the legend's div
as display:inline-block
.
#kpi{
height: 400px;
width: 100%;
border: 1px solid black;
background-color: white;
}
.pieLegend li span {
display: inline-block;
width: 12px;
height: 12px;
margin-right: 5px;
}
#top10Legend {
display: inline-block;
}
#container {
display: inline-block;
height: 50%;
width: 50%;
}
#top10Legend>ul{
list-style:none;
}