La linea donde intento insertar el array es aca :
Código:
El codigo : $barplot1->value->SetFormat($montos);
Código:
Una imagen :function consultarDeudoresMesGrafico($year) { $consulta = ""; if ($year == "") { $consulta = mysql_query("select id_deudor,month(fecha_pago_deudor) from deudores"); } else { $consulta = mysql_query("select id_deudor,month(fecha_pago_deudor) from deudores where year(fecha_pago_deudor)='" . $year . "'"); } $monto_total = "0"; if ($year == "") { $monto_total = totalDeudores(); } else { $monto_total = totalDeudorPorYear($year); } if (!is_numeric($monto_total)) { $monto_total = "0"; } $montos = array("300","400","600","800","900","200","300","100","400","600","800","900"); $cantidad = mysql_num_rows($consulta); $ids = array(); $Enero = 0; $Febrero = 0; $Marzo = 0; $Abril = 0; $Mayo = 0; $Junio = 0; $Julio = 0; $Agosto = 0; $Septiembre = 0; $Octubre = 0; $Noviembre = 0; $Diciembre = 0; while ($resultado = mysql_fetch_array($consulta)) { $id_cliente = $resultado[0]; $mes_pago = $resultado[1]; if (!in_array($id_cliente, $ids)) { array_push($ids, $id_cliente); if ($mes_pago == 1) { $Enero++; } if ($mes_pago == 2) { $Febrero++; } if ($mes_pago == 3) { $Marzo++; } if ($mes_pago == 4) { $Abril++; } if ($mes_pago == 5) { $Mayo++; } if ($mes_pago == 6) { $Junio++; } if ($mes_pago == 7) { $Julio++; } if ($mes_pago == 8) { $Agosto++; } if ($mes_pago == 9) { $Septiembre++; } if ($mes_pago == 10) { $Octubre++; } if ($mes_pago == 11) { $Noviembre++; } if ($mes_pago == 12) { $Diciembre++; } } } $textos = array( "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" ); $datos = array( $Enero, $Febrero, $Marzo, $Abril, $Mayo, $Junio, $Julio, $Agosto, $Septiembre, $Octubre, $Noviembre, $Diciembre ); $grafico = new Graph(500, 400, 'auto'); $grafico->SetScale("textlin"); $theme = new UniversalTheme; $grafico->SetTheme($theme); $grafico->title->Set("Cantidad de deudores por mes"); $grafico->Set90AndMargin(80, 40, 60, 40); $grafico->img->SetAngle(90); $grafico->yaxis->scale->SetGrace(20); $grafico->xaxis->title->Set(""); $grafico->yaxis->title->Set(""); $grafico->title->SetFont(FF_FONT1,FS_BOLD); $grafico->yaxis->title->SetFont(FF_FONT1,FS_BOLD); $grafico->xaxis->title->SetFont(FF_FONT1,FS_BOLD); $grafico->xaxis->SetTickLabels($textos); $grafico->footer->center->Set('Monto total : $' . $monto_total); $barplot1 = new BarPlot($datos); $grafico->Add($barplot1); $barplot1->SetWeight(0); $barplot1->SetFillGradient("#BE81F7", "#E3CEF6", GRAD_HOR); $barplot1->SetWidth(17); $barplot1->value->SetFormat($montos); $barplot1->value->Show(); $barplot1->value->HideZero(true); $barplot1->value->SetFont(FF_FONT1,FS_BOLD); $barplot1->SetValuePos('center'); $grafico->Stroke(); }
![](http://i.stack.imgur.com/QbjQg.jpg)
¿ Como puedo insertar el array $montos delante de cada barra ? ¿ Alguien se le ocurre otra forma ?