mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-23 13:55:43 +02:00
Merge branch 'ent-13616-elementos-sql-graph-de-informes-tienen-textos-oscuros-en-tema-oscuro' into 'develop'
Ent 13616 elementos sql graph de informes tienen textos oscuros en tema oscuro See merge request artica/pandorafms!7255
This commit is contained in:
commit
356ae025be
@ -547,6 +547,7 @@ function line_graph(
|
|||||||
function get_build_setup_charts($type, $options, $data)
|
function get_build_setup_charts($type, $options, $data)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
$user_info = get_user_info($config['id_user']);
|
||||||
|
|
||||||
$factory = new Factory();
|
$factory = new Factory();
|
||||||
|
|
||||||
@ -1294,6 +1295,10 @@ function get_build_setup_charts($type, $options, $data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($user_info['id_skin']) === true) {
|
||||||
|
$chart->options()->setTheme($user_info['id_skin']);
|
||||||
|
}
|
||||||
|
|
||||||
// Add Datasets.
|
// Add Datasets.
|
||||||
$setData = $chart->createDataSet();
|
$setData = $chart->createDataSet();
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
|
@ -2102,3 +2102,7 @@ select option:checked {
|
|||||||
#result_order .show_result_interpreter #result_items li.active {
|
#result_order .show_result_interpreter #result_items li.active {
|
||||||
background-color: var(--secondary-color);
|
background-color: var(--secondary-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.color_666 {
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
@ -92,6 +92,11 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
|
|||||||
*/
|
*/
|
||||||
protected $indexAxis;
|
protected $indexAxis;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $theme;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Layout
|
* @return Layout
|
||||||
@ -194,7 +199,7 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function disableAnimation()
|
public function disableAnimation()
|
||||||
{
|
{
|
||||||
@ -323,6 +328,32 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get font color.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getTheme()
|
||||||
|
{
|
||||||
|
return $this->theme;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set font color.
|
||||||
|
*
|
||||||
|
* @param string $Theme Global font color.
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setTheme($theme)
|
||||||
|
{
|
||||||
|
$this->theme = $theme;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
@ -131,8 +131,6 @@ class JavaScript extends Renderer
|
|||||||
$script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');';
|
$script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Create chart.
|
// Create chart.
|
||||||
$script[] = 'try {';
|
$script[] = 'try {';
|
||||||
$script[] = " var chart = new Chart( ctx, {$json} );";
|
$script[] = " var chart = new Chart( ctx, {$json} );";
|
||||||
@ -143,6 +141,32 @@ class JavaScript extends Renderer
|
|||||||
$script[] = ' Chart.defaults.font.style = "'.($this->chart->defaults()->getFonts()->getStyle() ?? 'normal').'";';
|
$script[] = ' Chart.defaults.font.style = "'.($this->chart->defaults()->getFonts()->getStyle() ?? 'normal').'";';
|
||||||
$script[] = ' Chart.defaults.font.weight = "'.($this->chart->defaults()->getFonts()->getWeight() ?? '').'";';
|
$script[] = ' Chart.defaults.font.weight = "'.($this->chart->defaults()->getFonts()->getWeight() ?? '').'";';
|
||||||
|
|
||||||
|
if ($this->chart->options()->getTheme() !== null) {
|
||||||
|
if ((int) $this->chart->options()->getTheme() === 2) {
|
||||||
|
$script[] = ' Chart.defaults.color = "#ffffff";';
|
||||||
|
|
||||||
|
$script[] = '
|
||||||
|
if (chart.config.options.scales !== undefined
|
||||||
|
&& chart.config.options.scales.x !== undefined
|
||||||
|
&& chart.config.options.scales.x.ticks !== undefined
|
||||||
|
) {
|
||||||
|
chart.config.options.scales.x.ticks.color = "#ffffff";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chart.config.options.scales !== undefined &&
|
||||||
|
chart.config.options.scales.y !== undefined &&
|
||||||
|
chart.config.options.scales.y.ticks !== undefined
|
||||||
|
) {
|
||||||
|
chart.config.options.scales.y.ticks.color = "#ffffff";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chart.config.options.title !== undefined ) {
|
||||||
|
chart.config.options.title.fontColor = "#ffffff";
|
||||||
|
}
|
||||||
|
';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$script[] = '} catch (error) {';
|
$script[] = '} catch (error) {';
|
||||||
$script[] = ' console.error(error);';
|
$script[] = ' console.error(error);';
|
||||||
$script[] = '}';
|
$script[] = '}';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user