phpchartjs pandora_enterprise#9554

This commit is contained in:
daniel 2022-12-21 12:33:53 +01:00
parent 872b079b20
commit 1dee676d5b
8 changed files with 65 additions and 144 deletions

View File

@ -551,11 +551,11 @@
},
{
"name": "artica/phpchartjs",
"version": "v1.0.1",
"version": "v1.0.2",
"dist": {
"type": "path",
"url": "../../../phpchartjs",
"reference": "7ec8ed26f31671a6fc0c91c294b48dc9625d7827"
"reference": "4957e7cd699e50cee8e0ba7304e1423aafb2cad2"
},
"require": {
"ext-dom": "*",

View File

@ -2226,19 +2226,15 @@ function reporting_event_report_group(
$return['chart']['validated_vs_unvalidated'] = null;
$options_charts = [
'width' => 500,
'height' => 150,
'viewport' => [
'width' => 500,
'height' => 0,
],
'legend' => [
'width' => 500,
'height' => 150,
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'pdf' => $pdf,
'ttl' => $ttl,
'pdf' => $pdf,
'ttl' => $ttl,
];
if ($pdf === true) {
@ -4372,19 +4368,15 @@ function reporting_event_report_agent(
$return['chart']['validated_vs_unvalidated'] = null;
$options_charts = [
'width' => 500,
'height' => 150,
'radius' => null,
'viewport' => [
'width' => 500,
'height' => 0,
],
'legend' => [
'width' => 500,
'height' => 150,
'radius' => null,
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'ttl' => $ttl,
'ttl' => $ttl,
];
if ((int) $ttl === 2) {
@ -11070,19 +11062,15 @@ function reporting_get_module_detailed_event(
}
$options_charts = [
'width' => 500,
'height' => 150,
'radius' => null,
'viewport' => [
'width' => 500,
'height' => 0,
],
'legend' => [
'width' => 500,
'height' => 150,
'radius' => null,
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'ttl' => $ttl,
'ttl' => $ttl,
];
if ((int) $ttl === 2) {

View File

@ -693,10 +693,10 @@ function get_build_setup_charts($type, $options, $data)
$legend->setAlign($legendAlign);
// Defaults fonts legends.
// $legend->labels()->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']);
// $legend->labels()->getFonts()->setStyle('normal');
// $legend->labels()->getFonts()->setWeight(600);
// $legend->labels()->getFonts()->setSize(((int) $config['font_size'] + 2));
$legend->labels()->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']);
$legend->labels()->getFonts()->setStyle('normal');
$legend->labels()->getFonts()->setWeight(600);
$legend->labels()->getFonts()->setSize(((int) $config['font_size'] + 2));
if (isset($options['legend']['fonts']) === true
&& empty($options['legend']['fonts']) === false
&& is_array($options['legend']['fonts']) === true

View File

@ -9,7 +9,7 @@
"readme": "README.md",
"homepage": "https://artica.es/",
"type": "package",
"version": "v1.0.1",
"version": "v1.0.2",
"license": "AGPL-3.0-or-later",
"authors": [
{

View File

@ -4,7 +4,8 @@ namespace Artica\PHPChartJS\Options;
use Artica\PHPChartJS\ArraySerializableInterface;
use Artica\PHPChartJS\Delegate\ArraySerializable;
use Artica\PHPChartJS\LabelsCollection;
use Artica\PHPChartJS\Labels;
use Artica\PHPChartJS\Options\Legend\Labels as LegendLabels;
use JsonSerializable;
use Laminas\Json\Expr;
@ -43,7 +44,7 @@ class Legend implements ArraySerializableInterface, JsonSerializable
private $onHover;
/**
* @var LabelsCollection
* @var Labels
*/
private $labels;
@ -171,12 +172,12 @@ class Legend implements ArraySerializableInterface, JsonSerializable
/**
* @return LabelsCollection
* @return Labels
*/
public function labels()
{
if (is_null($this->labels)) {
$this->labels = new LabelsCollection();
$this->labels = new LegendLabels();
}
return $this->labels;

View File

@ -4,6 +4,7 @@ namespace Artica\PHPChartJS\Options\Legend;
use Artica\PHPChartJS\ArraySerializableInterface;
use Artica\PHPChartJS\Delegate\ArraySerializable;
use Artica\PHPChartJS\Options\Fonts;
use JsonSerializable;
use Laminas\Json\Expr;
@ -17,32 +18,17 @@ class Labels implements ArraySerializableInterface, JsonSerializable
use ArraySerializable;
/**
* @var int
* @var integer
*/
private $boxWidth;
/**
* @var int
* @var Fonts
*/
private $fontSize;
private $font;
/**
* @var string
*/
private $fontStyle;
/**
* @var string
*/
private $fontColor;
/**
* @var string
*/
private $fontFamily;
/**
* @var int
* @var integer
*/
private $padding;
@ -52,20 +38,22 @@ class Labels implements ArraySerializableInterface, JsonSerializable
private $generateLabels;
/**
* @var bool
* @var boolean
*/
private $usePointStyle;
/**
* @return int
* @return integer
*/
public function getBoxWidth()
{
return $this->boxWidth;
}
/**
* @param int $boxWidth
* @param integer $boxWidth
*
* @return Labels
*/
@ -76,96 +64,33 @@ class Labels implements ArraySerializableInterface, JsonSerializable
return $this;
}
/**
* @return mixed
*/
public function getFontSize()
{
return $this->fontSize;
}
/**
* @param int $fontSize
* Return Font.
*
* @return Labels
* @return Font
*/
public function setFontSize($fontSize)
public function getFonts()
{
$this->fontSize = intval($fontSize);
if (isset($this->font) === false) {
$this->font = new Fonts();
}
return $this;
return $this->font;
}
/**
* @return string
*/
public function getFontStyle()
{
return $this->fontStyle;
}
/**
* @param string $fontStyle
*
* @return Labels
*/
public function setFontStyle($fontStyle)
{
$this->fontStyle = strval($fontStyle);
return $this;
}
/**
* @return string
*/
public function getFontColor()
{
return $this->fontColor;
}
/**
* @param string $fontColor
*
* @return Labels
*/
public function setFontColor($fontColor)
{
$this->fontColor = strval($fontColor);
return $this;
}
/**
* @return string
*/
public function getFontFamily()
{
return $this->fontFamily;
}
/**
* @param string $fontFamily
*
* @return Labels
*/
public function setFontFamily($fontFamily)
{
$this->fontFamily = strval($fontFamily);
return $this;
}
/**
* @return int
* @return integer
*/
public function getPadding()
{
return $this->padding;
}
/**
* @param int $padding
* @param integer $padding
*
* @return Labels
*/
@ -176,6 +101,7 @@ class Labels implements ArraySerializableInterface, JsonSerializable
return $this;
}
/**
* @return Expr
*/
@ -184,6 +110,7 @@ class Labels implements ArraySerializableInterface, JsonSerializable
return $this->generateLabels;
}
/**
* @param string $generateLabels
*
@ -196,26 +123,29 @@ class Labels implements ArraySerializableInterface, JsonSerializable
return $this;
}
/**
* @return bool
* @return boolean
*/
public function isUsePointStyle()
{
return $this->usePointStyle;
}
/**
* @param bool $usePointStyle
* @param boolean $usePointStyle
*
* @return Labels
*/
public function setUsePointStyle($usePointStyle)
{
$this->usePointStyle = ! ! $usePointStyle;
$this->usePointStyle = !!$usePointStyle;
return $this;
}
/**
* @return array
*/
@ -223,4 +153,6 @@ class Labels implements ArraySerializableInterface, JsonSerializable
{
return $this->getArrayCopy();
}
}

View File

@ -569,12 +569,12 @@
},
{
"name": "artica/phpchartjs",
"version": "v1.0.1",
"version_normalized": "1.0.1.0",
"version": "v1.0.2",
"version_normalized": "1.0.2.0",
"dist": {
"type": "path",
"url": "../../../phpchartjs",
"reference": "7ec8ed26f31671a6fc0c91c294b48dc9625d7827"
"reference": "4957e7cd699e50cee8e0ba7304e1423aafb2cad2"
},
"require": {
"ext-dom": "*",

View File

@ -3,7 +3,7 @@
'name' => 'pandorafms/console',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '2e48d517141e494775e9b22166f37eb589e06baa',
'reference' => '872b079b20910f3fa403f418df510e134db9f463',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -83,9 +83,9 @@
'dev_requirement' => false,
),
'artica/phpchartjs' => array(
'pretty_version' => 'v1.0.1',
'version' => '1.0.1.0',
'reference' => '7ec8ed26f31671a6fc0c91c294b48dc9625d7827',
'pretty_version' => 'v1.0.2',
'version' => '1.0.2.0',
'reference' => '4957e7cd699e50cee8e0ba7304e1423aafb2cad2',
'type' => 'package',
'install_path' => __DIR__ . '/../artica/phpchartjs',
'aliases' => array(),
@ -193,7 +193,7 @@
'pandorafms/console' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '2e48d517141e494775e9b22166f37eb589e06baa',
'reference' => '872b079b20910f3fa403f418df510e134db9f463',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),