New: Graph js librairie can accept colors and mix bar with plots.
This commit is contained in:
parent
993428e093
commit
66df4de8be
@ -154,7 +154,6 @@ if ($conf->use_javascript_ajax)
|
|||||||
$SommeD=0;
|
$SommeD=0;
|
||||||
$dataval=array();
|
$dataval=array();
|
||||||
$datalabels=array();
|
$datalabels=array();
|
||||||
$dataseries=array();
|
|
||||||
foreach ($AdherentType as $key => $adhtype)
|
foreach ($AdherentType as $key => $adhtype)
|
||||||
{
|
{
|
||||||
$datalabels[]=$adhtype->getNomUrl(0,dol_size(16));
|
$datalabels[]=$adhtype->getNomUrl(0,dol_size(16));
|
||||||
@ -167,15 +166,18 @@ if ($conf->use_javascript_ajax)
|
|||||||
$SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
$SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
||||||
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
$dataseries=array();
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=> $dataval['draft']);
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=> $dataval['draft']);
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=> $dataval['notuptodate']);
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=> $dataval['notuptodate']);
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=> $dataval['uptodate']);
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=> $dataval['uptodate']);
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=> $dataval['resiliated']);
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=> $dataval['resiliated']);
|
||||||
$data=array('series'=>$dataseries,'xlabel'=>$datalabels);
|
$data=array('series'=>$dataseries,'seriestype'=>array('bar','bar','bar','bar'),'xlabel'=>$datalabels);
|
||||||
dol_print_graph('stats2',300,180,$data,1,'bar');
|
dol_print_graph('stats2',300,180,$data,1,'barline');
|
||||||
$dataseries=array();
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$dataseries=array();
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=>array(round($SommeB)));
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=>array(round($SommeB)));
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=>array(round($SommeC)));
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=>array(round($SommeC)));
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=>array(round($SommeD)));
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=>array(round($SommeD)));
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class Propal extends CommonObject
|
|||||||
var $author;
|
var $author;
|
||||||
var $ref;
|
var $ref;
|
||||||
var $ref_client;
|
var $ref_client;
|
||||||
var $statut; // 0, 1, 2, 3, 4
|
var $statut; // 0 (draft), 1 (validated), 2 (signed), 3 (not signed), 4 (billed)
|
||||||
var $datec; // Date of creation
|
var $datec; // Date of creation
|
||||||
var $datev; // Date of validation
|
var $datev; // Date of validation
|
||||||
var $date; // Date of proposal
|
var $date; // Date of proposal
|
||||||
@ -1994,9 +1994,9 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return label of status of proposal (draft, validated, ...)
|
* Return label of status of proposal (draft, validated, ...)
|
||||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
* @param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||||
* \return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode=0)
|
||||||
{
|
{
|
||||||
@ -2004,10 +2004,10 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return label of a status (draft, validated, ...)
|
* Return label of a status (draft, validated, ...)
|
||||||
* \param statut id statut
|
* @param statut id statut
|
||||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
* @param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||||
* \return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$mode=1)
|
function LibStatut($statut,$mode=1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -19,11 +19,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/comm/propal/stats/index.php
|
* \file htdocs/comm/propal/stats/index.php
|
||||||
\ingroup propale
|
* \ingroup propale
|
||||||
\brief Page des stats propositions commerciales
|
* \brief Page des stats propositions commerciales
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../../../main.inc.php");
|
require("../../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propalestats.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propalestats.class.php");
|
||||||
@ -32,21 +32,24 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php");
|
|||||||
$WIDTH=500;
|
$WIDTH=500;
|
||||||
$HEIGHT=200;
|
$HEIGHT=200;
|
||||||
|
|
||||||
// S<EFBFBD>curit<EFBFBD> acc<63>s client
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$year = strftime("%Y", time());
|
$year = strftime("%Y", time());
|
||||||
$startyear=$year-2;
|
$startyear=$year-2;
|
||||||
$endyear=$year;
|
$endyear=$year;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$langs->load("propal");
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("ProposalsStatistics"), $mesg);
|
print_fiche_titre($langs->trans("ProposalsStatistics"), $mesg);
|
||||||
@ -65,40 +68,40 @@ $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
|||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
$filenamenb = $dir.'/proposalsnbinyear-'.$user->id.'-'.$year.'.png';
|
$filenamenb = $dir.'/proposalsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$user->id.'-'.$year.'.png';
|
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filenamenb = $dir.'/proposalsnbinyear-'.$year.'.png';
|
$filenamenb = $dir.'/proposalsnbinyear-'.$year.'.png';
|
||||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$year.'.png';
|
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$year.'.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
$px = new DolGraph();
|
$px = new DolGraph();
|
||||||
$mesg = $px->isGraphKo();
|
$mesg = $px->isGraphKo();
|
||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
$px->SetData($data);
|
$px->SetData($data);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
$i=$startyear;
|
$i=$startyear;
|
||||||
while ($i <= $endyear)
|
while ($i <= $endyear)
|
||||||
{
|
{
|
||||||
$legend[]=$i;
|
$legend[]=$i;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$px->SetLegend($legend);
|
$px->SetLegend($legend);
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||||
$px->SetWidth($WIDTH);
|
$px->SetWidth($WIDTH);
|
||||||
$px->SetHeight($HEIGHT);
|
$px->SetHeight($HEIGHT);
|
||||||
$px->SetYLabel($langs->trans("NbOfProposals"));
|
$px->SetYLabel($langs->trans("NbOfProposals"));
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
$px->mode='depth';
|
$px->mode='depth';
|
||||||
$px->SetTitle($langs->trans("NumberOfProposalsByMonth"));
|
$px->SetTitle($langs->trans("NumberOfProposalsByMonth"));
|
||||||
|
|
||||||
$px->draw($filenamenb);
|
$px->draw($filenamenb);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build graphic amount of object
|
// Build graphic amount of object
|
||||||
@ -108,40 +111,40 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
|||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
$filenameamount = $dir.'/proposalsamountinyear-'.$user->id.'-'.$year.'.png';
|
$filenameamount = $dir.'/proposalsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$user->id.'-'.$year.'.png';
|
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filenameamount = $dir.'/proposalsamountinyear-'.$year.'.png';
|
$filenameamount = $dir.'/proposalsamountinyear-'.$year.'.png';
|
||||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$year.'.png';
|
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$year.'.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
$px = new DolGraph();
|
$px = new DolGraph();
|
||||||
$mesg = $px->isGraphKo();
|
$mesg = $px->isGraphKo();
|
||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
$px->SetData($data);
|
$px->SetData($data);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
$i=$startyear;
|
$i=$startyear;
|
||||||
while ($i <= $endyear)
|
while ($i <= $endyear)
|
||||||
{
|
{
|
||||||
$legend[]=$i;
|
$legend[]=$i;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$px->SetLegend($legend);
|
$px->SetLegend($legend);
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||||
$px->SetWidth($WIDTH);
|
$px->SetWidth($WIDTH);
|
||||||
$px->SetHeight($HEIGHT);
|
$px->SetHeight($HEIGHT);
|
||||||
$px->SetYLabel($langs->trans("AmountOfProposals"));
|
$px->SetYLabel($langs->trans("AmountOfProposals"));
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
$px->mode='depth';
|
$px->mode='depth';
|
||||||
$px->SetTitle($langs->trans("AmountOfProposalsByMonthHT"));
|
$px->SetTitle($langs->trans("AmountOfProposalsByMonthHT"));
|
||||||
|
|
||||||
$px->draw($filenameamount);
|
$px->draw($filenameamount);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
||||||
@ -161,25 +164,25 @@ print '</tr>';
|
|||||||
$oldyear=0;
|
$oldyear=0;
|
||||||
foreach ($data as $val)
|
foreach ($data as $val)
|
||||||
{
|
{
|
||||||
$year = $val['year'];
|
$year = $val['year'];
|
||||||
print $avg;
|
print $avg;
|
||||||
while ($oldyear > $year+1)
|
while ($oldyear > $year+1)
|
||||||
{ // If we have empty year
|
{ // If we have empty year
|
||||||
$oldyear--;
|
$oldyear--;
|
||||||
print '<tr height="24">';
|
print '<tr height="24">';
|
||||||
print '<td align="center"><a href="month.php?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
print '<td align="center"><a href="month.php?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||||
print '<td align="right">0</td>';
|
print '<td align="right">0</td>';
|
||||||
print '<td align="right">0</td>';
|
print '<td align="right">0</td>';
|
||||||
print '<td align="right">0</td>';
|
print '<td align="right">0</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
print '<tr height="24">';
|
print '<tr height="24">';
|
||||||
print '<td align="center"><a href="month.php?year='.$year.'">'.$year.'</a></td>';
|
print '<td align="center"><a href="month.php?year='.$year.'">'.$year.'</a></td>';
|
||||||
print '<td align="right">'.$val['nb'].'</td>';
|
print '<td align="right">'.$val['nb'].'</td>';
|
||||||
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
|
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
|
||||||
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
|
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$oldyear=$year;
|
$oldyear=$year;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -192,9 +195,9 @@ print '<td align="center" valign="top">';
|
|||||||
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
||||||
if ($mesg) { print $mesg; }
|
if ($mesg) { print $mesg; }
|
||||||
else {
|
else {
|
||||||
print '<img src="'.$fileurlnb.'" title="'.$langs->trans("NbOfProposals").'" alt="'.$langs->trans("NbOfProposals").'">';
|
print '<img src="'.$fileurlnb.'" title="'.$langs->trans("NbOfProposals").'" alt="'.$langs->trans("NbOfProposals").'">';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print '<img src="'.$fileurlamount.'" title="'.$langs->trans("AmountTotal").'" alt="'.$langs->trans("AmountTotal").'">';
|
print '<img src="'.$fileurlamount.'" title="'.$langs->trans("AmountTotal").'" alt="'.$langs->trans("AmountTotal").'">';
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
|||||||
@ -1267,8 +1267,11 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie')
|
|||||||
{
|
{
|
||||||
if ($type == 'pie')
|
if ($type == 'pie')
|
||||||
{
|
{
|
||||||
// data is array('series'=>array(0=>serie1,1=>serie2,...));
|
// data is array('series'=>array(serie1,serie2,...),
|
||||||
// serie is array('label'=>'label', values=>array(0=>val))
|
// 'seriestype'=>array('bar','line',...),
|
||||||
|
// 'seriescolor'=>array(0=>'#999999',1=>'#999999',...)
|
||||||
|
// 'xlabel'=>array(0=>labelx1,1=>labelx2,...));
|
||||||
|
// serieX is array('label'=>'label', values=>array(0=>val))
|
||||||
print '
|
print '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(function () {
|
jQuery(function () {
|
||||||
@ -1314,15 +1317,16 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie')
|
|||||||
interactive: true
|
interactive: true
|
||||||
},
|
},
|
||||||
';
|
';
|
||||||
|
$i=0; $outputserie=0;
|
||||||
if (sizeof($datacolor))
|
if (sizeof($datacolor))
|
||||||
{
|
{
|
||||||
print 'colors: [';
|
print 'colors: [';
|
||||||
$j=0;
|
|
||||||
foreach($datacolor as $val)
|
foreach($datacolor as $val)
|
||||||
{
|
{
|
||||||
print '"'.$val.'"';
|
if ($outputserie > 0) print ',';
|
||||||
if ($j < sizeof($datacolor)) print ',';
|
print '"'.(empty($data['seriescolor'][$i])?$val:$data['seriescolor'][$i]).'"';
|
||||||
$j++;
|
$outputserie++;
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
print '], ';
|
print '], ';
|
||||||
}
|
}
|
||||||
@ -1333,18 +1337,23 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie')
|
|||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
}
|
}
|
||||||
else if ($type == 'bar')
|
else if ($type == 'barline')
|
||||||
{
|
{
|
||||||
// data is array('series'=>array(0=>serie1,1=>serie2,...),'xlabel'=>array(0=>label1,1=>label2,...));
|
// data is array('series'=>array(serie1,serie2,...),
|
||||||
// serie is array('label'=>'label', values=>array(0=>val1,1=>val2,...))
|
// 'seriestype'=>array('bar','line',...),
|
||||||
|
// 'seriescolor'=>array(0=>'#999999',1=>'#999999',...)
|
||||||
|
// 'xlabel'=>array(0=>labelx1,1=>labelx2,...));
|
||||||
|
// serieX is array('label'=>'label', values=>array(0=>y1,1=>y2,...)) with same nb of value than into xlabel
|
||||||
print '
|
print '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(function () {
|
jQuery(function () {
|
||||||
var data = [';
|
var data = [';
|
||||||
$i=1;
|
$i=1; $outputserie=0;
|
||||||
foreach($data['series'] as $serie)
|
foreach($data['series'] as $serie)
|
||||||
{
|
{
|
||||||
print '{label: \''.dol_escape_js($serie['label']).'\', data: [';
|
if ($data['seriestype'][$i-1]=='line') { $i++; continue; };
|
||||||
|
if ($outputserie > 0) print ',';
|
||||||
|
print '{ bars: { stack: 0, show: true, barWidth: 0.9, align: \'center\' }, label: \''.dol_escape_js($serie['label']).'\', data: [';
|
||||||
$j=1;
|
$j=1;
|
||||||
foreach($serie['values'] as $val)
|
foreach($serie['values'] as $val)
|
||||||
{
|
{
|
||||||
@ -1352,8 +1361,28 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie')
|
|||||||
if ($j < sizeof($serie['values'])) print ', ';
|
if ($j < sizeof($serie['values'])) print ', ';
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
print ']}';
|
print ']}'."\n";
|
||||||
if ($i < sizeof($data['series'])) print ',';
|
$outputserie++;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
if ($outputserie) print ', ';
|
||||||
|
//print '];
|
||||||
|
//var datalines = [';
|
||||||
|
$i=1; $outputserie=0;
|
||||||
|
foreach($data['series'] as $serie)
|
||||||
|
{
|
||||||
|
if (empty($data['seriestype'][$i-1]) || $data['seriestype'][$i-1]=='bar') { $i++; continue; };
|
||||||
|
if ($outputserie > 0) print ',';
|
||||||
|
print '{ lines: { show: true }, label: \''.dol_escape_js($serie['label']).'\', data: [';
|
||||||
|
$j=1;
|
||||||
|
foreach($serie['values'] as $val)
|
||||||
|
{
|
||||||
|
print '['.$j.','.$val.']';
|
||||||
|
if ($j < sizeof($serie['values'])) print ', ';
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
print ']}'."\n";
|
||||||
|
$outputserie++;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '];
|
print '];
|
||||||
@ -1367,16 +1396,11 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie')
|
|||||||
}
|
}
|
||||||
print '];
|
print '];
|
||||||
|
|
||||||
var stack = 0, bars = true, lines = false, steps = false;
|
|
||||||
|
|
||||||
function plotWithOptions() {
|
function plotWithOptions() {
|
||||||
jQuery.plot(jQuery("#'.$htmlid.'"), data,
|
jQuery.plot(jQuery("#'.$htmlid.'"), data,
|
||||||
{
|
{
|
||||||
series: {
|
series: {
|
||||||
stack: stack,
|
stack: 0
|
||||||
lines: { show: lines, fill: true, steps: steps },
|
|
||||||
bars: { show: bars, barWidth: 0.9, align: \'center\' },
|
|
||||||
shadowSize: 5
|
|
||||||
},
|
},
|
||||||
zoom: {
|
zoom: {
|
||||||
interactive: true
|
interactive: true
|
||||||
@ -3674,13 +3698,13 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
|
|||||||
$ret='';
|
$ret='';
|
||||||
$out='';
|
$out='';
|
||||||
$divstart=$divend='';
|
$divstart=$divend='';
|
||||||
|
|
||||||
if (isset($_SESSION['mesg']))
|
if (isset($_SESSION['mesg']))
|
||||||
{
|
{
|
||||||
$mesgstring=$_SESSION['mesg'];
|
$mesgstring=$_SESSION['mesg'];
|
||||||
unset($_SESSION['mesg']);
|
unset($_SESSION['mesg']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_SESSION['mesgarray']))
|
if (isset($_SESSION['mesgarray']))
|
||||||
{
|
{
|
||||||
$mesgarray=$_SESSION['mesgarray'];
|
$mesgarray=$_SESSION['mesgarray'];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user