答案 0 :(得分:0)
var chartLegend = "<ul style=\"list-style-type: none; padding: 0\">";
for(var i = 0; i < chartDatas.datasets.length; i++)
{
chartLegend += "<li><span style=\"background-color:" + chartDatas.datasets[i].pointColor + ";height:20px; width:20px; display:inline-table; margin:5px;\"></span>" + chartDatas.datasets[i].label + "</li>"
}