1
I’m trying to define the colors of the Brazilian states, which are coming from mysql via json the information, but I’m not having resulted in the return of colors. Ex.:
São Paulo in color Blue - Minas Gerais in color Green - Rio Grande do Sul in color Red
and so on, how can I define these colors? Since I am doing it in the following way:
colorAxis: {colors: ['#00853f', 'black', '#e31b23']},
backgroundColor: '#81d4fa',
datalessRegionColor: '#f8bbd0',
defaultColor: '#f5f5f5',
JSON
$estados = Estados::selectRaw('SUM(valor) as valor, estado as estado')->groupBy('estado')->get();
$arrayEstados[] = ['Estado', 'Valor'];
foreach($estados as $key => $valor) {
$arrayEstados[++$key] = [$valor->estado, $valor->valor];
}
dd($arrayEstados);
return view('home', compact('notasEntrada', 'notasSaida', 'valorNotasEntrada', 'valorNotasSaida'))->with('nome', json_encode($array))->with('estados', json_encode($arrayEstados));
and so I’m not controlling the colors of the states.
Thanks in advance
You are using the Lavacharts library?
– sant0will
I’m not using any @sant0will library
– Cristiano Facirolli
Yes, you are using the Google Chart API right
– sant0will
Ah yes... just her! @sant0will
– Cristiano Facirolli
how is your json? edit the question and put it
– sant0will
ready @sant0will edited the question with JSON and its return
– Cristiano Facirolli
Let’s go continue this discussion in chat.
– sant0will