I need to inverse the data from my chart, like when I get the data from March 2015 to April 2014, I want that March 2015(actual time) to be on the right, not on the left. I'm using SVGGraph library. Thank you!
$graph = new SVGGraph($w, $h, $settings);
$data = [];
for ($i = 1; $i <= 12; $i++) {
switch ($op) {
case "eaqf-f":
$data["$y-$m"] = StatUtil::getTotalEaInvoiced($y, $m, $oid);
$data["$y-$m"] = $data["$y-$m"]['q'];
break;
case "cv-val":
$data["$y-$m"] = StatUtil::getInvoicedCVs($y, $m, $oid);
break;
case "eaqf-r":
$data["$y-$m"] = StatUtil::getTotalConsumption($y, $m, $oid);
break;
default: throw RuntimeException("Unsupported op: $op");
}
if (--$m == 0) {
$m = 12;
--$y;
}
}
$graph ->Values($data);
$graph ->Render("Linegraph");