I have a problem here, which may be simple, I do not know I'm using a graphic frame, where I can put the labels I want so it can be displayed at each bar. Staying like this:
Eachitem(January,February,March...correspondstoalabelinthefollowingcode:
vardata={labels:["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
I'm wanting to get these labels
through the database I use, and even I do this normally, and display array
normally. However, I'm trying the following code:
var data = {
labels: ["<?php foreach ($fase as $fase){ echo $fase->nomefase;} ?>"],
datasets: [
The problem with this code is that I can not insert a comma to separate the array
items I'm looking for from the database. At the time of entering the comma, foreach
ends, and starts again, causing me to display no items, or if I only have one item in array
, it displays the first and only.
I tried to break several times in fragments and tried so hard to make it work, but it gives error.