How to create dynamic color list for charts
Basically i have a different value in my database or each values contain each percentage and i need to show this percentages in pie chart with different colors ….
This is the example code of pie chart in static way
<color value="#99CDFB"/>
<color value="#3366FB"/>
<color value="#0000FA"/>
<color value="#F8CC00"/>
<color value="#F89900"/>
<color value="#F76600"/>
but i need dynamic way using PHP ( for loop / foreach loop) like this
$color = "";
foreach($data as $data){
echo '<color value=".$color."/>';
}
and i don’t know to create dynamic color list also see the screenshot for verification

For random string of colors, here:
Then, in your function, use
$colors = randColor( 6 );to create a total of 6 different colors. After that, here’s your output color method.