This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 640dac1eff fix: Big Number side cut fixed (#31407)
640dac1eff is described below
commit 640dac1eff50229b5b945791d1e99488c707be91
Author: Fardin Mustaque <[email protected]>
AuthorDate: Fri Dec 27 16:51:58 2024 +0530
fix: Big Number side cut fixed (#31407)
Co-authored-by: Geido <[email protected]>
---
.../plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git
a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx
b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx
index 04c6e74c69..d7882ccdb6 100644
---
a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx
+++
b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx
@@ -120,7 +120,7 @@ class BigNumberVis extends PureComponent<BigNumberVizProps>
{
className="kicker"
style={{
fontSize,
- height: maxHeight,
+ height: 'auto',
}}
>
{text}
@@ -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,
@@ -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}
@@ -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,
@@ -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;