reduce longer module name on odometers VC
This commit is contained in:
parent
b3f4e68934
commit
197ae303e2
|
@ -53,6 +53,16 @@ final class Odometer extends Item
|
|||
$return['thresholds'] = $this->extractThresholds($data);
|
||||
$return['titleColor'] = $this->extractTitleColor($data);
|
||||
$return['title'] = $this->extractTitle($data);
|
||||
$module_text = $return['moduleName'];
|
||||
|
||||
$string_length = strlen($return['moduleName']);
|
||||
if ($string_length >= 25) {
|
||||
$module_text = substr($return['moduleName'], 0, 9);
|
||||
$module_text .= ' ... ';
|
||||
$module_text .= substr($return['moduleName'], -9);
|
||||
}
|
||||
|
||||
$return['moduleName'] = $module_text;
|
||||
$return['minMaxValue'] = $this->extractMinMaxValue($data);
|
||||
|
||||
return $return;
|
||||
|
|
|
@ -212,7 +212,7 @@ export default class Odometer extends Item<OdometerProps> {
|
|||
} else {
|
||||
h2.textContent = this.truncateTitle(this.props.title);
|
||||
}
|
||||
h2.style.fontSize = `12px`;
|
||||
h2.style.fontSize = `${anchoB * 0.06}px`;
|
||||
h2.style.color = `${this.props.titleColor}`;
|
||||
h2.style.lineHeight = "0";
|
||||
|
||||
|
|
Loading…
Reference in New Issue