0
Gentlemen, I am using the Google library to Lavacharts, but I have the following result:
On my controller I’m doing so:
$graf = new Lavacharts;
$valor = $graf->DataTable();
$valores = Produtos::select("nome as 0", "preco as 1")->get()->toArray();
$valor->addStringColumn("Preço")
->addNumberColumn("Nome")
->addRows($valores);
$graf->BarChart('Preço', $valor);
return view('home', ["graf" => $graf ]);
in my view I ask to display according to what the Library recommences
<div class="col-md-6" id="pop_div"></div>
<?= $graf->render("BarChart", "Preço", "pop_div"); ?>
Someone can give me a light?
Thank you
What appears in code (view-source)?
– Eduardo Stuart
There’s nothing wrong, as if it’s running perfectly as you can see https://prnt.sc/mif76m @Eduardostuart
– Cristiano Facirolli
What appears to you if you
dd($valores)
(right after the $values=...) line? Make sure there are values to display?– Eduardo Stuart
yes, I have https://prnt.sc/mifb7e @Eduardostuart
– Cristiano Facirolli
Wouldn’t the columns be swapped? Just change the order of select, price first and then name.
– Eduardo Stuart
Nothing returned, https://prnt.sc/mifgpx @Eduardostuart
– Cristiano Facirolli
my controller looks like this https://prnt.sc/mifk2j @Eduardostuart
– Cristiano Facirolli
Let’s go continue this discussion in chat.
– Cristiano Facirolli