New: Enhance graphical boxes. Prepare to show filters form to modify
graph.
This commit is contained in:
parent
a386179f47
commit
99e5bf3120
@ -74,10 +74,10 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
||||
'subtext'=>$langs->trans("Refresh"),
|
||||
'subpicto'=>'refresh.png',
|
||||
'target'=>'none'
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
if ($user->rights->facture->lire)
|
||||
@ -88,11 +88,11 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
$shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB));
|
||||
$showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT));
|
||||
$nowarray=dol_getdate(dol_now(),true);
|
||||
$endyear=$nowarray['year'];
|
||||
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||
$startyear=$endyear-1;
|
||||
$mode='customer';
|
||||
$userid=0;
|
||||
$WIDTH='256';
|
||||
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||
$HEIGHT='192';
|
||||
|
||||
$stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||
@ -175,9 +175,23 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
|
||||
if (! $mesg)
|
||||
{
|
||||
$stringtoshow='';
|
||||
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||
$stringtoshow.='</a>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
{
|
||||
$stringtoshow ='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) $stringtoshow.=$px1->show();
|
||||
|
||||
@ -73,10 +73,10 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
||||
'subtext'=>$langs->trans("Refresh"),
|
||||
'subpicto'=>'refresh.png',
|
||||
'target'=>'none'
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
@ -87,11 +87,11 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
$shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB));
|
||||
$showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT));
|
||||
$nowarray=dol_getdate(dol_now(),true);
|
||||
$endyear=$nowarray['year'];
|
||||
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||
$startyear=$endyear-1;
|
||||
$mode='supplier';
|
||||
$userid=0;
|
||||
$WIDTH='256';
|
||||
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||
$HEIGHT='192';
|
||||
|
||||
$stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||
@ -174,9 +174,23 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
|
||||
if (! $mesg)
|
||||
{
|
||||
$stringtoshow='';
|
||||
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||
$stringtoshow.='</a>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
{
|
||||
$stringtoshow ='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) $stringtoshow.=$px1->show();
|
||||
|
||||
@ -74,10 +74,10 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
||||
'subtext'=>$langs->trans("Refresh"),
|
||||
'subpicto'=>'refresh.png',
|
||||
'target'=>'none'
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
if ($user->rights->commande->lire)
|
||||
@ -88,11 +88,11 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
$shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB));
|
||||
$showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT));
|
||||
$nowarray=dol_getdate(dol_now(),true);
|
||||
$endyear=$nowarray['year'];
|
||||
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||
$startyear=$endyear-1;
|
||||
$mode='customer';
|
||||
$userid=0;
|
||||
$WIDTH='256';
|
||||
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||
$HEIGHT='192';
|
||||
|
||||
$stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||
@ -175,9 +175,23 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
|
||||
if (! $mesg)
|
||||
{
|
||||
$stringtoshow='';
|
||||
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||
$stringtoshow.='</a>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
{
|
||||
$stringtoshow ='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) $stringtoshow.=$px1->show();
|
||||
|
||||
@ -73,10 +73,10 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
||||
'subtext'=>$langs->trans("Refresh"),
|
||||
'subpicto'=>'refresh.png',
|
||||
'target'=>'none'
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
if ($user->rights->fournisseur->commande->lire)
|
||||
@ -87,11 +87,11 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
$shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB));
|
||||
$showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT));
|
||||
$nowarray=dol_getdate(dol_now(),true);
|
||||
$endyear=$nowarray['year'];
|
||||
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||
$startyear=$endyear-1;
|
||||
$mode='supplier';
|
||||
$userid=0;
|
||||
$WIDTH='256';
|
||||
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||
$HEIGHT='192';
|
||||
|
||||
$stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||
@ -174,9 +174,23 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
|
||||
if (! $mesg)
|
||||
{
|
||||
$stringtoshow='';
|
||||
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||
$stringtoshow.='</a>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
{
|
||||
$stringtoshow ='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) $stringtoshow.=$px1->show();
|
||||
|
||||
@ -74,10 +74,10 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>$_SERVER["PHP_SELF"].'?action='.$refreshaction,
|
||||
'subtext'=>$langs->trans("Refresh"),
|
||||
'subpicto'=>'refresh.png',
|
||||
'target'=>'none'
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
if ($user->rights->commande->lire)
|
||||
@ -88,11 +88,11 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
$shownb=(! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_NB));
|
||||
$showtot=(! isset($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT));
|
||||
$nowarray=dol_getdate(dol_now(),true);
|
||||
$endyear=$nowarray['year'];
|
||||
$endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']);
|
||||
$startyear=$endyear-1;
|
||||
$mode='customer';
|
||||
$userid=0;
|
||||
$WIDTH='256';
|
||||
$WIDTH=($shownb && $showtot)?'256':'320';
|
||||
$HEIGHT='192';
|
||||
|
||||
$stats = new PropaleStats($this->db, 0, $mode, ($userid>0?$userid:0));
|
||||
@ -101,7 +101,8 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
if ($shownb)
|
||||
{
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||
|
||||
$datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars');
|
||||
|
||||
$filenamenb = $dir."/propalsnbinyear-".$year.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsnbinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsnbinyear-'.$year.'.png';
|
||||
@ -110,6 +111,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px1->SetType($datatype1);
|
||||
$px1->SetData($data1);
|
||||
unset($data1);
|
||||
$px1->SetPrecisionY(0);
|
||||
@ -139,7 +141,9 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
if ($showtot)
|
||||
{
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
|
||||
|
||||
$datatype2 = array_pad(array(), ($endyear-$startyear+1), 'bars');
|
||||
//$datatype2 = array('lines','bars');
|
||||
|
||||
$filenamenb = $dir."/propalsamountinyear-".$year.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$year.'.png';
|
||||
@ -148,6 +152,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
$px2->SetType($datatype2);
|
||||
$px2->SetData($data2);
|
||||
unset($data2);
|
||||
$px2->SetPrecisionY(0);
|
||||
@ -175,9 +180,23 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
|
||||
if (! $mesg)
|
||||
{
|
||||
$stringtoshow='';
|
||||
$stringtoshow.='<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
|
||||
jQuery("#idfilter'.$this->boxcode.'").toggle();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">';
|
||||
$stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">';
|
||||
$stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png');
|
||||
$stringtoshow.='</a>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
{
|
||||
$stringtoshow ='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichecenter">';
|
||||
$stringtoshow.='<div class="fichehalfleft">';
|
||||
}
|
||||
if ($shownb) $stringtoshow.=$px1->show();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -135,13 +135,13 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
||||
print "\n\n<!-- Box start -->\n";
|
||||
print '<div class="box" id="boxto_'.$this->box_id.'">'."\n";
|
||||
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || $nblines)
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
|
||||
{
|
||||
print '<table summary="boxtable'.$this->box_id.'" width="100%" class="noborder boxtable">'."\n";
|
||||
}
|
||||
|
||||
// Show box title
|
||||
if (! empty($head['text']) || ! empty($head['sublink']))
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']))
|
||||
{
|
||||
//print '<div id="boxto_'.$this->box_id.'_title">'."\n";
|
||||
//print '<table summary="boxtabletitle'.$this->box_id.'" width="100%" class="noborder">'."\n";
|
||||
@ -158,10 +158,10 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
||||
$s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
|
||||
print $s;
|
||||
}
|
||||
if (! empty($head['sublink']))
|
||||
{
|
||||
print ' <a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>'.img_picto($head['subtext'],$head['subpicto']).'</a>';
|
||||
}
|
||||
print ' ';
|
||||
if (! empty($head['sublink'])) print '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>';
|
||||
if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="" id="idsubimg'.$this->boxcode.'"');
|
||||
if (! empty($head['sublink'])) '</a>';
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '</td><td class="nocellnopadd boxclose nowrap">';
|
||||
@ -175,8 +175,8 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
// print "</table>\n";
|
||||
// print "</div>\n";
|
||||
//print "</table>\n";
|
||||
//print "</div>\n";
|
||||
}
|
||||
|
||||
// Show box lines
|
||||
@ -251,13 +251,13 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || $nblines)
|
||||
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
|
||||
{
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
// If invisible box with no contents
|
||||
if (empty($head['text']) && empty($head['sublink']) && ! $nblines) print "<br>\n";
|
||||
if (empty($head['text']) && empty($head['sublink']) && empty($head['subpicto']) && ! $nblines) print "<br>\n";
|
||||
|
||||
print "</div>\n";
|
||||
print "<!-- Box end -->\n\n";
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
class DolGraph
|
||||
{
|
||||
//! Type of graph
|
||||
var $type=array('bars'); // bars, lines, ...
|
||||
var $type=array(); // Array with type of each series. Example: array('bars', 'lines', ...)
|
||||
var $mode='side'; // Mode bars graph: side, depth
|
||||
private $_library='jflot'; // Graphic library to use (jflot, artichow)
|
||||
|
||||
@ -578,8 +578,9 @@ class DolGraph
|
||||
|
||||
// Create graph
|
||||
$classname='';
|
||||
if ($this->type[0] == 'bars') $classname='BarPlot'; // Only first type of type is supported by artichow
|
||||
if ($this->type[0] == 'lines') $classname='LinePlot';
|
||||
if (! isset($this->type[0]) || $this->type[0] == 'bars') $classname='BarPlot'; // Only one type (first one) is supported by artichow
|
||||
else if ($this->type[0] == 'lines') $classname='LinePlot';
|
||||
else $classname='TypeUnknown';
|
||||
include_once ARTICHOW_PATH.$classname.'.class.php';
|
||||
|
||||
// Definition de couleurs
|
||||
|
||||
@ -76,7 +76,7 @@ abstract class Stats
|
||||
dol_syslog(get_class($this).'_'.__FUNCTION__." cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load file into $data
|
||||
if ($foundintocache) // Cache file found and is not too old
|
||||
{
|
||||
@ -184,14 +184,14 @@ abstract class Stats
|
||||
}
|
||||
|
||||
$data = array();
|
||||
|
||||
// $data = array('xval'=>array(0=>xlabel,1=>yval1,2=>yval2...),...)
|
||||
for ($i = 0 ; $i < 12 ; $i++)
|
||||
{
|
||||
$data[$i][]=$datay[$endyear][$i][0];
|
||||
$data[$i][]=$datay[$endyear][$i][0]; // set label
|
||||
$year=$startyear;
|
||||
while($year <= $endyear)
|
||||
{
|
||||
$data[$i][]=$datay[$year][$i][1];
|
||||
$data[$i][]=$datay[$year][$i][1]; // set yval for x=i
|
||||
$year++;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user