Skip to content

Commit

Permalink
✨ (discrete bar) thin zero line
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Jan 3, 2025
1 parent 9319dae commit 2df1f11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ export class DiscreteBarChart
const { manager, boundsWithoutColorLegend, yAxis, innerBounds } = this

const axisLineWidth = manager.isStaticAndSmall
? GRAPHER_AXIS_LINE_WIDTH_THICK
: GRAPHER_AXIS_LINE_WIDTH_DEFAULT
? 0.5 * GRAPHER_AXIS_LINE_WIDTH_THICK
: 0.5 * GRAPHER_AXIS_LINE_WIDTH_DEFAULT

return (
<>
Expand Down Expand Up @@ -537,6 +537,14 @@ export class DiscreteBarChart
horizontalAxis={yAxis}
bounds={innerBounds}
strokeWidth={axisLineWidth}
// if the chart doesn't have negative values, then we
// move the zero line a little to the left to avoid
// overlap with the bars
align={
this.hasNegative
? HorizontalAlign.center
: HorizontalAlign.right
}
/>
)}
{this.renderBars()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ export class StackedDiscreteBarChart
<HorizontalAxisZeroLine
horizontalAxis={yAxis}
bounds={innerBounds}
strokeWidth={axisLineWidth}
strokeWidth={0.5 * axisLineWidth}
// moves the zero line a little to the left to avoid
// overlap with the bars
align={HorizontalAlign.right}
Expand Down

0 comments on commit 2df1f11

Please sign in to comment.