Skip to content

Commit

Permalink
correctly compute slice width in dashboard (apache#5867)
Browse files Browse the repository at this point in the history
(cherry picked from commit 166058d)
  • Loading branch information
kristw committed Sep 12, 2018
1 parent 8c0b15a commit 38b8047
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
GRID_MIN_COLUMN_COUNT,
GRID_MIN_ROW_UNITS,
GRID_BASE_UNIT,
GRID_GUTTER_SIZE,
} from '../../util/constants';

const CHART_MARGIN = 32;
Expand Down Expand Up @@ -131,8 +132,14 @@ class ChartHolder extends React.Component {
>
<Chart
id={component.meta.chartId}
width={widthMultiple * columnWidth - CHART_MARGIN / 2}
height={component.meta.height * GRID_BASE_UNIT - CHART_MARGIN}
width={Math.floor(
widthMultiple * columnWidth +
(widthMultiple - 1) * GRID_GUTTER_SIZE -
CHART_MARGIN,
)}
height={Math.floor(
component.meta.height * GRID_BASE_UNIT - CHART_MARGIN,
)}
sliceName={component.meta.sliceName || ''}
updateSliceName={this.handleUpdateSliceName}
/>
Expand Down

0 comments on commit 38b8047

Please sign in to comment.