Acá la imagen para que me entiendan:
Y acá el código:
Código PHP:
Ver original
<?php // content="text/plain; charset=utf-8" require_once ('src/jpgraph.php'); require_once ('src/jpgraph_bar.php'); // Create the graph. $graph = new Graph(400,400); $graph->title->Set('Ejemplo'); // Setup Y and Y2 scales with some "grace" $graph->SetScale("textlin"); $graph->SetY2Scale("lin"); $graph->yaxis->scale->SetGrace(10); $graph->y2axis->scale->SetGrace(10); // Setup graph colors $graph->yaxis->SetColor('#61A9F3'); $graph->y2axis->SetColor('#76CE73'); // Create the "dummy" 0 bplot $bplotzero = new BarPlot($datazero); // Create the "Y" axis group $ybplot1 = new BarPlot($datay); $ybplot1->value->Show(); $ybplot1->SetLegend("Propietarios"); // Create the "Y2" axis group $ybplot2 = new BarPlot($datay2); $ybplot2->value->Show(); $ybplot2->SetLegend("Presidentes"); // Add the grouped bar plots to the graph $graph->Add($ybplot); $graph->AddY2($y2bplot); // .. and finally stroke the image back to browser $graph->Stroke(); ?>