Adjusted chart code to use colors as defined in each theme's layout.inc.php
This commit is contained in:
@@ -70,20 +70,8 @@ abstract class PMA_pChart_chart extends PMA_chart
|
|||||||
// as in CSS (top, right, bottom, left)
|
// as in CSS (top, right, bottom, left)
|
||||||
$this->setAreaMargins(array(20, 20, 40, 60));
|
$this->setAreaMargins(array(20, 20, 40, 60));
|
||||||
|
|
||||||
// when graph area gradient is used, this is the color of the graph
|
// Get color settings from theme
|
||||||
// area border
|
$this->settings = array_merge($this->settings,$GLOBALS['cfg']['chartColor']);
|
||||||
$this->settings['graphAreaColor'] = '#D5D9DD';
|
|
||||||
|
|
||||||
// the background color of the graph area
|
|
||||||
$this->settings['graphAreaGradientColor'] = '#A3CBA7';
|
|
||||||
|
|
||||||
// the color of the grid lines in the graph area
|
|
||||||
$this->settings['gridColor'] = '#E6E6E6';
|
|
||||||
|
|
||||||
// the color of the scale and the labels
|
|
||||||
$this->settings['scaleColor'] = '#D5D9DD';
|
|
||||||
|
|
||||||
$this->settings['titleBgColor'] = '#000000';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function init()
|
protected function init()
|
||||||
@@ -145,12 +133,15 @@ abstract class PMA_pChart_chart extends PMA_chart
|
|||||||
*/
|
*/
|
||||||
protected function drawCommon()
|
protected function drawCommon()
|
||||||
{
|
{
|
||||||
$this->chart->drawGraphAreaGradient(
|
$this->chart->drawGraphAreaGradient(
|
||||||
$this->getBgColor(RED),
|
$this->getBgColor(RED),
|
||||||
$this->getBgColor(GREEN),
|
$this->getBgColor(GREEN),
|
||||||
$this->getBgColor(BLUE),
|
$this->getBgColor(BLUE),
|
||||||
50,TARGET_BACKGROUND);
|
// With a gradientIntensity of 0 the background does't draw, oddly
|
||||||
$this->chart->addBorder(2);
|
($this->settings['gradientIntensity']==0)?1:$this->settings['gradientIntensity'],TARGET_BACKGROUND);
|
||||||
|
|
||||||
|
if(is_string($this->settings['border']))
|
||||||
|
$this->chart->addBorder(1,$this->getBorderColor(RED),$this->getBorderColor(GREEN),$this->getBorderColor(BLUE));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,11 +161,10 @@ abstract class PMA_pChart_chart extends PMA_chart
|
|||||||
$this->getTitleColor(GREEN),
|
$this->getTitleColor(GREEN),
|
||||||
$this->getTitleColor(BLUE),
|
$this->getTitleColor(BLUE),
|
||||||
ALIGN_CENTER,
|
ALIGN_CENTER,
|
||||||
True,
|
false,
|
||||||
$this->getTitleBgColor(RED),
|
$this->getTitleBgColor(RED),
|
||||||
$this->getTitleBgColor(GREEN),
|
$this->getTitleBgColor(GREEN),
|
||||||
$this->getTitleBgColor(BLUE),
|
$this->getTitleBgColor(BLUE)
|
||||||
30
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,12 +201,21 @@ abstract class PMA_pChart_chart extends PMA_chart
|
|||||||
$this->getScaleColor(BLUE),
|
$this->getScaleColor(BLUE),
|
||||||
TRUE,0,2,TRUE
|
TRUE,0,2,TRUE
|
||||||
);
|
);
|
||||||
$this->chart->drawGraphAreaGradient(
|
|
||||||
$this->getGraphAreaGradientColor(RED),
|
if($this->settings['gradientIntensity']>0)
|
||||||
$this->getGraphAreaGradientColor(GREEN),
|
$this->chart->drawGraphAreaGradient(
|
||||||
$this->getGraphAreaGradientColor(BLUE),
|
$this->getGraphAreaGradientColor(RED),
|
||||||
50
|
$this->getGraphAreaGradientColor(GREEN),
|
||||||
);
|
$this->getGraphAreaGradientColor(BLUE),
|
||||||
|
$this->settings['gradientIntensity']
|
||||||
|
);
|
||||||
|
else
|
||||||
|
$this->chart->drawGraphArea(
|
||||||
|
$this->getGraphAreaGradientColor(RED),
|
||||||
|
$this->getGraphAreaGradientColor(GREEN),
|
||||||
|
$this->getGraphAreaGradientColor(BLUE)
|
||||||
|
);
|
||||||
|
|
||||||
$this->chart->drawGrid(
|
$this->chart->drawGrid(
|
||||||
4,
|
4,
|
||||||
TRUE,
|
TRUE,
|
||||||
@@ -393,6 +392,11 @@ abstract class PMA_pChart_chart extends PMA_chart
|
|||||||
{
|
{
|
||||||
return $this->hexStrToDecComp($this->settings['titleBgColor'], $component);
|
return $this->hexStrToDecComp($this->settings['titleBgColor'], $component);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getBorderColor($component)
|
||||||
|
{
|
||||||
|
return $this->hexStrToDecComp($this->settings['border'], $component);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -57,12 +57,20 @@ class PMA_pChart_multi_radar extends PMA_pChart_multi
|
|||||||
$this->getGraphAreaColor(BLUE),
|
$this->getGraphAreaColor(BLUE),
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
$this->chart->drawGraphAreaGradient(
|
|
||||||
$this->getGraphAreaGradientColor(RED),
|
if($this->settings['gradientIntensity']>0)
|
||||||
$this->getGraphAreaGradientColor(GREEN),
|
$this->chart->drawGraphAreaGradient(
|
||||||
$this->getGraphAreaGradientColor(BLUE),
|
$this->getGraphAreaGradientColor(RED),
|
||||||
50
|
$this->getGraphAreaGradientColor(GREEN),
|
||||||
);
|
$this->getGraphAreaGradientColor(BLUE),
|
||||||
|
$this->settings['gradientIntensity']
|
||||||
|
);
|
||||||
|
else
|
||||||
|
$this->chart->drawGraphArea(
|
||||||
|
$this->getGraphAreaGradientColor(RED),
|
||||||
|
$this->getGraphAreaGradientColor(GREEN),
|
||||||
|
$this->getGraphAreaGradientColor(BLUE)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -47,12 +47,21 @@ class PMA_pChart_Pie extends PMA_pChart_multi
|
|||||||
$this->getGraphAreaColor(BLUE),
|
$this->getGraphAreaColor(BLUE),
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
$this->chart->drawGraphAreaGradient(
|
|
||||||
$this->getGraphAreaGradientColor(RED),
|
if($this->settings['gradientIntensity']>0)
|
||||||
$this->getGraphAreaGradientColor(GREEN),
|
$this->chart->drawGraphAreaGradient(
|
||||||
$this->getGraphAreaGradientColor(BLUE),
|
$this->getGraphAreaGradientColor(RED),
|
||||||
50
|
$this->getGraphAreaGradientColor(GREEN),
|
||||||
);
|
$this->getGraphAreaGradientColor(BLUE),
|
||||||
|
$this->settings['gradientIntensity']
|
||||||
|
);
|
||||||
|
else
|
||||||
|
$this->chart->drawGraphArea(
|
||||||
|
$this->getGraphAreaGradientColor(RED),
|
||||||
|
$this->getGraphAreaGradientColor(GREEN),
|
||||||
|
$this->getGraphAreaGradientColor(BLUE)
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -48,12 +48,21 @@ class PMA_pChart_single_radar extends PMA_pChart_single
|
|||||||
$this->getGraphAreaColor(BLUE),
|
$this->getGraphAreaColor(BLUE),
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
$this->chart->drawGraphAreaGradient(
|
|
||||||
$this->getGraphAreaGradientColor(RED),
|
if($this->settings['gradientIntensity']>0)
|
||||||
$this->getGraphAreaGradientColor(GREEN),
|
$this->chart->drawGraphAreaGradient(
|
||||||
$this->getGraphAreaGradientColor(BLUE),
|
$this->getGraphAreaGradientColor(RED),
|
||||||
50
|
$this->getGraphAreaGradientColor(GREEN),
|
||||||
);
|
$this->getGraphAreaGradientColor(BLUE),
|
||||||
|
$this->settings['gradientIntensity']
|
||||||
|
);
|
||||||
|
else
|
||||||
|
$this->chart->drawGraphArea(
|
||||||
|
$this->getGraphAreaGradientColor(RED),
|
||||||
|
$this->getGraphAreaGradientColor(GREEN),
|
||||||
|
$this->getGraphAreaGradientColor(BLUE)
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -110,4 +110,29 @@ $GLOBALS['cfg']['SQP']['fmtColor'] = array(
|
|||||||
'quote_single' => '',
|
'quote_single' => '',
|
||||||
'quote_backtick' => ''
|
'quote_backtick' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chart colors
|
||||||
|
*/
|
||||||
|
|
||||||
|
$GLOBALS['cfg']['chartColor'] = array(
|
||||||
|
'gradientIntensity' => 0,
|
||||||
|
// The style of the chart title.
|
||||||
|
'titleColor' => '#000000',
|
||||||
|
'titleBgColor' => $GLOBALS['cfg']['ThBackground'],
|
||||||
|
// Chart border (0 for no border)
|
||||||
|
'border' => '#CCCCCC',
|
||||||
|
// Chart background color.
|
||||||
|
'bgColor' => $GLOBALS['cfg']['BgTwo'],
|
||||||
|
// when graph area gradient is used, this is the color of the graph
|
||||||
|
// area border
|
||||||
|
'graphAreaColor' => '#D5D9DD',
|
||||||
|
// the background color of the inner graph area
|
||||||
|
'graphAreaGradientColor'=> $GLOBALS['cfg']['BgOne'],
|
||||||
|
// the color of the grid lines in the graph area
|
||||||
|
'gridColor' => '#E6E6E6',
|
||||||
|
// the color of the scale and the labels
|
||||||
|
'scaleColor' => '#D5D9DD',
|
||||||
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -112,4 +112,30 @@ $GLOBALS['cfg']['SQP']['fmtColor'] = array(
|
|||||||
'quote_single' => '',
|
'quote_single' => '',
|
||||||
'quote_backtick' => ''
|
'quote_backtick' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chart colors
|
||||||
|
*/
|
||||||
|
|
||||||
|
$GLOBALS['cfg']['chartColor'] = array(
|
||||||
|
'gradientIntensity' => 50,
|
||||||
|
// The style of the chart title.
|
||||||
|
'titleColor' => '#000000',
|
||||||
|
'titleBgColor' => '#E5E5E5',
|
||||||
|
// Chart border (0 for no border)
|
||||||
|
'border' => '#CCCCCC',
|
||||||
|
// Chart background color.
|
||||||
|
'bgColor' => '#FBFBFB',
|
||||||
|
// when graph area gradient is used, this is the color of the graph
|
||||||
|
// area border
|
||||||
|
'graphAreaColor' => '#D5D9DD',
|
||||||
|
// the background color of the graph area
|
||||||
|
'graphAreaGradientColor'=> $GLOBALS['cfg']['BgTwo'],
|
||||||
|
// the color of the grid lines in the graph area
|
||||||
|
'gridColor' => '#E6E6E6',
|
||||||
|
// the color of the scale and the labels
|
||||||
|
'scaleColor' => '#D5D9DD',
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user