DEV Community

Discussion on: Create charts in Laravel with eloquent and Larapex Charts

Collapse
 
sissi1995 profile image
sissi1995 • Edited

Hi,
please how can use different color in graph type "bar", i try to use function setColors() but it doesn't work with "bar". I have one table passed to setDataset(), it work but the same color for all bars.
thank you

Collapse
 
arielmejiadev profile image
Ariel Mejia

Hi, I will check thanks, there is another way to handle the colors, you can set colors with the config file in: config/larapex.php file, you need to run the command:

php artisan publish

and then select the config file of Larapex, but remember that this would override the entire array of color order.

Thanks for the feedback.

Collapse
 
sissi1995 profile image
sissi1995

Hi, thank you for the answer. I tried before to set color with config/larapex.php file, with the same result.
So i find that we can do it in apexcharts by puting one parameter "distributed" on "true",
like in publicapexcharts.js :
plotOptions:
{bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,endingShape:"flat",colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1}
but doesn't work with larapex package.
I hope you can find a solution, i really need it.
Thank you.

Thread Thread
 
arielmejiadev profile image
Ariel Mejia

I will check these days for sure :)