Got same problem here.
I found that obsidian-charts only adds the default colors when parsing yml.
Thus, I managed to work around with something like
const labels = [];
const tagPages = dv.pages('#fixkosten');
const kosten =[];
tagPages.forEach(note => {
// add the name of the note
labels.push(note.file.name);
// add the word count for the note
kosten.push(note.Entspricht);
});
dv.paragraph(`\`\`\`chart
type: 'doughnut'
labels: ${labels}
labelColors: true
series:
- data: ${kosten}
\`\`\``)
If you really want to use window.renderChart, you may consider building your own obsidian-chart plugin with dependency chart.js ^4.0.0, then you will get some default colors from chart.js.