Skip to content

Commit

Permalink
fix: Big Number side cut fixed (#31407)
Browse files Browse the repository at this point in the history
Co-authored-by: Geido <60598000+geido@users.noreply.github.com>
  • Loading branch information
fardin-developer and geido authored Dec 27, 2024
1 parent 9321ab9 commit 640dac1
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class BigNumberVis extends PureComponent<BigNumberVizProps> {
className="kicker"
style={{
fontSize,
height: maxHeight,
height: 'auto',
}}
>
{text}
Expand Down Expand Up @@ -156,7 +156,7 @@ class BigNumberVis extends PureComponent<BigNumberVizProps> {
document.body.append(container);
const fontSize = computeMaxFontSize({
text,
maxWidth: width - 8, // Decrease 8px for more precise font size
maxWidth: width * 0.9, // reduced it's max width
maxHeight,
className: 'header-line',
container,
Expand All @@ -174,8 +174,10 @@ class BigNumberVis extends PureComponent<BigNumberVizProps> {
<div
className="header-line"
style={{
display: 'flex',
alignItems: 'center',
fontSize,
height: maxHeight,
height: 'auto',
color: numberColor,
}}
onContextMenu={onContextMenu}
Expand Down Expand Up @@ -204,7 +206,7 @@ class BigNumberVis extends PureComponent<BigNumberVizProps> {
document.body.append(container);
fontSize = computeMaxFontSize({
text,
maxWidth: width,
maxWidth: width * 0.9, // max width reduced
maxHeight,
className: 'subheader-line',
container,
Expand Down Expand Up @@ -356,6 +358,7 @@ export default styled(BigNumberVis)`
position: relative;
line-height: 1em;
white-space: nowrap;
margin-bottom:${theme.gridUnit * 2}px;
span {
position: absolute;
bottom: 0;
Expand Down

0 comments on commit 640dac1

Please sign in to comment.