Skip to content

Commit

Permalink
updates for heights on bar charts
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdoe committed Oct 1, 2024
1 parent a3bd27e commit 8f99fbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/chart/src/CdcChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default function CdcChart({
const renderedOrientation = useVertical ? responsiveVertical : 'horizontal'
let height = config.aspectRatio ? width * config.aspectRatio : config?.heights?.[renderedOrientation]
if (config.visualizationType === 'Pie') height = config?.heights?.[renderedOrientation]
height = height + Number(config?.xAxis?.size) + 45
height = height + Number(config.orientation === 'horizontal' ? config.yAxis.size : config?.xAxis?.size) + 45

type Config = typeof config
let legendMemo = useRef(new Map()) // map collection
Expand Down
2 changes: 1 addition & 1 deletion packages/chart/src/components/LinearChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const LinearChart: React.FC<LinearChartProps> = props => {
leftMax,
rightMax,
dimensions,
xMax: props.parentWidth - Number(config.yAxis.size)
xMax: props.parentWidth - Number(config.orientation === 'horizontal' ? config.xAxis.size : config.yAxis.size)
})

// sets the portal x/y for where tooltips should appear on the page.
Expand Down

0 comments on commit 8f99fbf

Please sign in to comment.