javascript - ChartJS Legend Not Lining Up -
i creating legend line graph generated using chartjs. problem running color boxes in legend not lining correctly. here how generate legend:
var chartlegend = "<ul style=\"list-style-type: none;\">"; for(var = 0; < chartdatas.datasets.length; i++) { chartlegend += "<li><div style=\"background-color:" + chartdatas.datasets[i].pointcolor + ";height:20px; width:20px; float:left; margin:5px;\"></div>" + chartdatas.datasets[i].label + "</li>" } chartlegend += "</ul>";
is possible line boxes?
var chartlegend = "<ul style=\"list-style-type: none; padding: 0\">"; for(var = 0; < 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>" }
Comments
Post a Comment