我当前使用的是chartist-legend-plugin,它很棒,但是当涉及到图例的颜色时,它是行不通的。有谁知道如何在图表师手中抓取一系列颜色?因为图表专家会自动生成不同的颜色,但是插件当然没有它
JS:
new Chartist.Bar('.ct-chart-bar', {
labels: ['First quarter of the year', 'Second quarter of the year', 'Third quarter of the year', 'Fourth quarter of the year'],
series: [
{ "name": "Money A", "data": [60000, 40000, 80000, 70000] },
{ "name": "Money B", "data": [40000, 30000, 70000, 65000] },
{ "name": "Money C", "data": [8000, 3000, 10000, 6000] }
],
}, {
fullWidth: true,
chartPadding: {
top: 40
},
high : 100000,
plugins: [
Chartist.plugins.legend(),
]
});
Run Code Online (Sandbox Code Playgroud)
CSS:
.ct-legend …Run Code Online (Sandbox Code Playgroud)