[ChartJS] Use default color by default
By default, charts are grey. It's not really pretty.
But we can use the default palette from chartsjs:
https://www.chartjs.org/docs/latest/general/colors.html#default-color-palette
WDYT?
Haha voting for orange 🧡 here! 😁
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
nope, keep open
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Friendly ping? Should this still be open? I will close if I don't hear anything.
I don't know if/when we made a change, but symfony/ux-chartjs currently uses the Charts.js color palette per default.
I removed the hard-coded colors in the website controller code, and added a couple of lines.
Result: the entire Color.js palette and a transparent background (added a light violet-ish background to the wrapping div)
$chart->setData([
'labels' => ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
'datasets' => [
...array_map(fn($i) => [
'label' => 'Line '.$i,
'data' => array_map(fn($i) => $i + rand(0,20) - 5, [10, 15, 4, 3, 25, 41, 25]),
'tension' => rand(0,1) / 10,
], range(1, 7)),
],
]);
Super, thanks