Código PHP:
Ver original
function pintarGraficaFlu() { $estaciones = Station::where('technique_id', '=', '12')->orderBy('name', 'DESC')->get(); foreach ($estaciones as $key => $value) { JpGraph::module('line'); $graph = new Graph(1100,400,'auto'); $graph->SetScale('linlin'); $graph->SetMargin(70,70,40,50); $graph->SetMarginColor('white'); $graph->title->Set('Flujos de Lodo'); $graph->subtitle->Set($value->name); $graph->xaxis->SetPos('min'); $graph->xaxis->SetLabelAngle(0); $graph->xaxis->SetTickLabels($xdata); $graph->xaxis->HideLastTickLabel(); $graph->xgrid->Show(); $graph->yscale->SetAutoTicks(); $key = new LinePlot($bdata); $graph->Add($key); $key->SetColor("#7fff00"); $key->SetLegend('Bateria'); $graph->Stroke(); $fileName = "/tmp/imagen/".$value->name.".png"; $graph->img->Stream($fileName); } }