ux icon indicating copy to clipboard operation
ux copied to clipboard

[ChartJS] Use default color by default

Open lyrixx opened this issue 2 years ago • 4 comments

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?

lyrixx avatar Mar 29 '23 07:03 lyrixx

Haha voting for orange 🧡 here! 😁

WebMamba avatar Apr 19 '23 18:04 WebMamba

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Apr 25 '24 12:04 carsonbot

nope, keep open

lyrixx avatar Apr 25 '24 13:04 lyrixx

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Oct 26 '24 12:10 carsonbot

Friendly ping? Should this still be open? I will close if I don't hear anything.

carsonbot avatar Nov 09 '24 12:11 carsonbot

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)

image Capture d’écran 2024-11-09 à 22 20 51
$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)),
   ],
]);

smnandre avatar Nov 09 '24 21:11 smnandre

Super, thanks

lyrixx avatar Nov 12 '24 09:11 lyrixx