mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°541 - Dashlets: Improve readability when to much labels (pie chart) or too long labels (bar chart)
This commit is contained in:
@@ -1009,7 +1009,6 @@ EOF
|
||||
$iTotalCount = 0;
|
||||
$aValues = array();
|
||||
$aURLs = array();
|
||||
$iMaxNbCharsInLabel = 0;
|
||||
|
||||
foreach ($aRes as $iRow => $aRow)
|
||||
{
|
||||
@@ -1019,9 +1018,6 @@ EOF
|
||||
$iTotalCount += $aRow['_itop_count_'];
|
||||
$aValues[] = array('label' => html_entity_decode(strip_tags($sHtmlValue), ENT_QUOTES, 'UTF-8'), 'label_html' => $sHtmlValue, 'value' => (int) $aRow[$sFctVar]);
|
||||
|
||||
if ($iMaxNbCharsInLabel < mb_strlen($sValue)) {
|
||||
$iMaxNbCharsInLabel = mb_strlen($sValue);
|
||||
}
|
||||
|
||||
// Build the search for this subset
|
||||
$oSubsetSearch = $this->m_oFilter->DeepClone();
|
||||
@@ -1036,9 +1032,13 @@ EOF
|
||||
{
|
||||
case 'bars':
|
||||
$aNames = array();
|
||||
$iMaxNbCharsInLabel = 0;
|
||||
foreach($aValues as $idx => $aValue)
|
||||
{
|
||||
$aNames[$idx] = $aValue['label'];
|
||||
if ($iMaxNbCharsInLabel < mb_strlen($aValue['label'])) {
|
||||
$iMaxNbCharsInLabel = mb_strlen($aValue['label']);
|
||||
}
|
||||
}
|
||||
$sJSNames = json_encode($aNames);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user