#10740 heatmap improvements 2

This commit is contained in:
Daniel Maya 2023-04-05 12:25:33 +02:00
parent dc654c0b6d
commit 91f2336ff4
2 changed files with 43 additions and 11 deletions

View File

@ -1359,13 +1359,23 @@ class Heatmap
if (count($groups) > 1 && $this->group === 1 && $this->dashboard === false) {
$x_back = 0;
$y_back = 0;
$x_text_correction = 0.25;
if ($count_result <= 100) {
if ($count_result <= 10) {
$fontSize = 'small-size';
$stroke = 'small-stroke';
} else {
} else if ($count_result > 10 && $count_result <= 100) {
$fontSize = 'tiny-size';
$stroke = 'tiny-stroke';
} else if ($count_result > 100 && $count_result <= 1000) {
$fontSize = 'medium-size';
$stroke = 'medium-stroke';
} else if ($count_result > 1000 && $count_result <= 10000) {
$fontSize = 'big-size';
$stroke = 'big-stroke';
} else {
$fontSize = 'huge-size';
$stroke = 'huge-stroke';
}
echo '<polyline points="0,0 '.$Xaxis.',0" class="polyline '.$stroke.'" />';
@ -1419,7 +1429,7 @@ class Heatmap
echo '<polyline points="'.$points.'" class="polyline '.$stroke.'" />';
// Name.
echo '<text x="'.((($x_position - $x_back) / 2) + $x_back).'" y="'.($y_position + 1).'"
echo '<text x="'.((($x_position - $x_back) / 2) + $x_back - $x_text_correction).'" y="'.($y_position + 1 - 0.01).'"
class="'.$fontSize.'">'.$name.'</text>';
$x_back = $x_position;
@ -1470,7 +1480,7 @@ class Heatmap
echo '<polyline points="'.$points.'" class="polyline '.$stroke.'" />';
// Name.
echo '<text x="'.(($x_position) / 2).'" y="'.($y_position + 1).'"
echo '<text x="'.(($x_position) / 2 - $x_text_correction).'" y="'.($y_position + 1 - 0.01).'"
class="'.$fontSize.'">'.$name.'</text>';
// Bottom-right of last line.
@ -1527,7 +1537,7 @@ class Heatmap
echo '<polyline points="'.$points.'" class="polyline '.$stroke.'" />';
// Name.
echo '<text x="'.(($x_position) / 2).'" y="'.($y_position + 1).'"
echo '<text x="'.(($x_position) / 2 - $x_text_correction).'" y="'.($y_position + 1 - 0.02).'"
class="'.$fontSize.'">'.$name.'</text>';
// Bottom-top of last line.

View File

@ -185,8 +185,6 @@
.hover:hover {
filter: brightness(1.5);
stroke-width: 0.009;
stroke: black;
}
.group {
@ -272,19 +270,43 @@ div#heatmap-controls div.heatmap-refr > div {
}
.small-stroke {
stroke-width: 0.03;
stroke-width: 0.005;
}
.tiny-stroke {
stroke-width: 0.01;
}
.medium-stroke {
stroke-width: 0.02;
}
.big-stroke {
stroke-width: 0.05;
stroke-width: 0.03;
}
.huge-stroke {
stroke-width: 0.04;
}
.small-size {
font-size: 0.2px;
font-size: 1%;
}
.tiny-size {
font-size: 2%;
}
.medium-size {
font-size: 4%;
}
.big-size {
font-size: 0.4px;
font-size: 6%;
}
.huge-size {
font-size: 8%;
}
.progress_main {