Browse Source

Add color to levels

master
Kai Kretschmann 1 year ago
parent
commit
08d9ffa213
1 changed files with 12 additions and 4 deletions
  1. 12
    4
      js/lggr_stat_data.php

+ 12
- 4
js/lggr_stat_data.php View File

@@ -19,9 +19,9 @@ if (isset($_SESSION[LggrState::SESSIONNAME])) {
} // if

$aColors = array(
'emerg' => COLORALERT,
'crit' => COLORALERT,
'err' => COLORALERT,
'emerg' => '#'.COLORALERT,
'crit' => '#'.COLORALERT,
'err' => '#'.COLORALERT,
'warning' => '#f0ad4e',
'notice' => '#337ab7',
'info' => '#5cb85c'
@@ -87,10 +87,18 @@ var dataLevels = {
<?php
foreach ($aLevels as $level) {
$newVal = round(log($level->c));
// $newCol = $aColors[$level->level];
$newCol = $aColors[$level->level];
echo "{$newVal}, ";
} // foreach
?>
],
backgroundColor: [
<?php
foreach ($aLevels as $level) {
$newCol = $aColors[$level->level];
echo "'{$newCol}', ";
} // foreach
?>
]
}],
labels: [

Loading…
Cancel
Save
Social stuff:
Mastodon