mirror of
https://github.com/apache/superset.git
synced 2026-06-04 15:19:25 +00:00
fix(dashboard): Fix BigNumber causing dashboard to crash when overflowing (#19688)
* fix(dashboard): fix(plugin-chart-echarts): Fix BigNumber causing dashboard to crash when overflowing * Add tooltips for truncated titles * Fix type
This commit is contained in:
committed by
GitHub
parent
4a5dddf52d
commit
ee85466f2e
@@ -113,6 +113,12 @@ const ChartOverlay = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
const SliceContainer = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 100%;
|
||||
`;
|
||||
|
||||
export default class Chart extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@@ -210,7 +216,10 @@ export default class Chart extends React.Component {
|
||||
|
||||
getChartHeight() {
|
||||
const headerHeight = this.getHeaderHeight();
|
||||
return this.state.height - headerHeight - this.state.descriptionHeight;
|
||||
return Math.max(
|
||||
this.state.height - headerHeight - this.state.descriptionHeight,
|
||||
20,
|
||||
);
|
||||
}
|
||||
|
||||
getHeaderHeight() {
|
||||
@@ -370,7 +379,7 @@ export default class Chart extends React.Component {
|
||||
})
|
||||
: {};
|
||||
return (
|
||||
<div
|
||||
<SliceContainer
|
||||
className="chart-slice"
|
||||
data-test="chart-grid-component"
|
||||
data-test-chart-id={id}
|
||||
@@ -407,6 +416,8 @@ export default class Chart extends React.Component {
|
||||
isFullSize={isFullSize}
|
||||
chartStatus={chart.chartStatus}
|
||||
formData={formData}
|
||||
width={width}
|
||||
height={this.getHeaderHeight()}
|
||||
/>
|
||||
|
||||
{/*
|
||||
@@ -468,7 +479,7 @@ export default class Chart extends React.Component {
|
||||
datasetsStatus={datasetsStatus}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</SliceContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user