mirror of https://github.com/MISP/MISP
fix: [UI] Round percentage change in periodic summary
parent
a545966ce3
commit
2873a8da4c
|
@ -56,7 +56,7 @@ class TrendingTool
|
|||
$trendAnalysis[$previousTimestamp][$tag] = [
|
||||
'occurrence' => 0,
|
||||
'raw_change' => -$amount,
|
||||
'percent_change' => 100 * (-$amount / $amount),
|
||||
'percent_change' => round(100 * (-$amount / $amount), 2),
|
||||
'change_sign' => -$amount > 0 ? 1 : (-$amount < 0 ? -1 : 0),
|
||||
];
|
||||
}
|
||||
|
|
|
@ -92,7 +92,6 @@ if (!function_exists('computeLinePositions')) {
|
|||
return $conf;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div style="display: flex; column-gap: 20px; justify-content: space-around; margin-bottom: 40px;">
|
||||
|
@ -255,7 +254,7 @@ if (!function_exists('computeLinePositions')) {
|
|||
<tr>
|
||||
<td><?= h($clusteredTags[$previousPeriod][$tagName]['occurrence'] ?? '-') ?></td>
|
||||
<td><?= h($clusteredTags[$previousPeriod][$tagName]['raw_change'] ?? '-') ?></td>
|
||||
<td><?= h($clusteredTags[$previousPeriod][$tagName]['percent_change'] ?? '-') ?>%</td>
|
||||
<td><?= h($clusteredTags[$previousPeriod][$tagName]['percent_change'] ?? '-') ?> %</td>
|
||||
<td style="font-size: large; color: <?= $trendColorMapping[$clusteredTags[$previousPeriod][$tagName]['change_sign'] ?? '?'] ?>"><?= $trendIconMapping[$clusteredTags[$previousPeriod][$tagName]['change_sign'] ?? '?'] ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -267,7 +266,7 @@ if (!function_exists('computeLinePositions')) {
|
|||
<tr>
|
||||
<td><?= h($clusteredTags[$currentPeriod][$tagName]['occurrence'] ?? '-') ?></td>
|
||||
<td><?= h($clusteredTags[$currentPeriod][$tagName]['raw_change'] ?? '-') ?></td>
|
||||
<td><?= h($clusteredTags[$currentPeriod][$tagName]['percent_change'] ?? '-') ?>%</td>
|
||||
<td><?= h($clusteredTags[$currentPeriod][$tagName]['percent_change'] ?? '-') ?> %</td>
|
||||
<td style="font-size: large; color: <?= $trendColorMapping[$clusteredTags[$currentPeriod][$tagName]['change_sign'] ?? '?'] ?>"><?= $trendIconMapping[$clusteredTags[$currentPeriod][$tagName]['change_sign'] ?? '?'] ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in New Issue