Killing unicorns and magic numbers.
This commit is contained in:
parent
9ad8b1035c
commit
0be8792b01
|
@ -314,6 +314,7 @@ define ('MODULE_PREDICTION_NETFLOW', 4);
|
|||
|
||||
/* SNMP CONSTANTS */
|
||||
define('SNMP_DIR_MIBS', "attachment/mibs");
|
||||
|
||||
define('SNMP_TRAP_TYPE_NONE', -1);
|
||||
define('SNMP_TRAP_TYPE_COLD_START', 0);
|
||||
define('SNMP_TRAP_TYPE_WARM_START', 1);
|
||||
|
@ -428,4 +429,8 @@ define("COLLECTION_UNSAVED", 3);
|
|||
|
||||
/* PAGINATION */
|
||||
define("PAGINATION_BLOCKS_LIMIT", 15);
|
||||
|
||||
/* CHARTS */
|
||||
define("CHART_DEFAULT_WIDTH", 150);
|
||||
define("CHART_DEFAULT_HEIGHT", 110);
|
||||
?>
|
||||
|
|
|
@ -216,13 +216,13 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||
|
||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||
|
||||
// ATTENTION: The min size is 110x150
|
||||
// ATTENTION: The min size is in constants.php
|
||||
// It's not the same minsize for all graphs, but we are choosed a prudent minsize for all
|
||||
if ($height <= 110) {
|
||||
$height = 110;
|
||||
if ($height <= CHART_DEFAULT_HEIGHT) {
|
||||
$height = CHART_DEFAULT_HEIGHT;
|
||||
}
|
||||
if ($width < 150) {
|
||||
$width = 150;
|
||||
if ($width < CHART_DEFAULT_WIDTH) {
|
||||
$width = CHART_DEFAULT_WIDTH;
|
||||
}
|
||||
|
||||
if (empty($chart_data)) {
|
||||
|
|
Loading…
Reference in New Issue