问题
I have two pie charts with different data but same labels and background colors. How can I create a standalone legend (a legend without a chart) using ChartJS so that the legend corresponds to both the pie charts at the same time?
I tried creating a pie chart with the data array set to an array of 0s. However, that causes an empty pie chart to be generated, which takes up a lot of space; so that's a no go.
Any help would be deeply appreciated.
来源:https://stackoverflow.com/questions/51610867/one-legend-multiple-charts-chart-js