NEW: Graphics can be horizontal bars.

This commit is contained in:
Laurent Destailleur 2020-12-04 22:30:34 +01:00
parent b9f7d9ab4b
commit af1bb09338
2 changed files with 4 additions and 2 deletions

View File

@ -216,6 +216,7 @@ NEW: add a message in error_log after detection of SQL or script injection
NEW: add __TYPE__ substitution key
NEW: add validation of MX domain for emails
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
NEW: Graphics can be horizontal bars.
HOOKs
NEW: Hook on propal card

View File

@ -39,7 +39,7 @@
*/
class DolGraph
{
public $type = array(); // Array with type of each series. Example: array('bars', 'lines', ...)
public $type = array(); // Array with type of each series. Example: array('bars', 'horizontalbars', 'lines', 'pies', 'piesemicircle', 'polar'...)
public $mode = 'side'; // Mode bars graph: side, depth
private $_library = 'chart'; // Graphic library to use (jflot, chart, artichow)
@ -261,7 +261,7 @@ class DolGraph
* Set type
*
* @param array $type Array with type for each serie. Example: array('type1', 'type2', ...) where type can be:
* 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', ...
* 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', 'horirontalbars'...
* @return void
*/
public function SetType($type)
@ -1156,6 +1156,7 @@ class DolGraph
else {
$type = 'bar';
if (!isset($this->type[$firstlot]) || $this->type[$firstlot] == 'bars') $type = 'bar';
if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'horizontalbars') $type = 'horizontalBar';
if (isset($this->type[$firstlot]) && ($this->type[$firstlot] == 'lines' || $this->type[$firstlot] == 'linesnopoint')) $type = 'line';
$this->stringtoshow .= 'var options = { maintainAspectRatio: false, aspectRatio: 2.5, ';