Skip to content

Commit

Permalink
✨ (discrete bar) remove vertical grid lines (#3974)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann authored Sep 19, 2024
1 parent 3a9fa35 commit 2eeef9c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
26 changes: 14 additions & 12 deletions packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,21 @@ export class DiscreteBarChart
<HorizontalNumericColorLegend manager={this} />
)}
{this.showHorizontalAxis && (
<HorizontalAxisComponent
bounds={boundsWithoutColorLegend}
axis={yAxis}
preferredAxisPosition={innerBounds.bottom}
labelColor={manager.secondaryColorInStaticCharts}
tickMarkWidth={axisLineWidth}
/>
<>
<HorizontalAxisComponent
bounds={boundsWithoutColorLegend}
axis={yAxis}
preferredAxisPosition={innerBounds.bottom}
labelColor={manager.secondaryColorInStaticCharts}
tickMarkWidth={axisLineWidth}
/>
<HorizontalAxisGridLines
horizontalAxis={yAxis}
bounds={innerBounds}
strokeWidth={axisLineWidth}
/>
</>
)}
<HorizontalAxisGridLines
horizontalAxis={yAxis}
bounds={innerBounds}
strokeWidth={axisLineWidth}
/>
{sizedSeries.map((series) => {
// Todo: add a "placedSeries" getter to get the transformed series, then just loop over the placedSeries and render a bar for each
const isNegative = series.value < 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,19 +682,21 @@ export class StackedDiscreteBarChart
fill="rgba(255,255,255,0)"
/>
{this.showHorizontalAxis && (
<HorizontalAxisComponent
bounds={bounds}
axis={yAxis}
preferredAxisPosition={innerBounds.bottom}
labelColor={manager.secondaryColorInStaticCharts}
tickMarkWidth={axisLineWidth}
/>
<>
<HorizontalAxisComponent
bounds={bounds}
axis={yAxis}
preferredAxisPosition={innerBounds.bottom}
labelColor={manager.secondaryColorInStaticCharts}
tickMarkWidth={axisLineWidth}
/>
<HorizontalAxisGridLines
horizontalAxis={yAxis}
bounds={innerBounds}
strokeWidth={axisLineWidth}
/>
</>
)}
<HorizontalAxisGridLines
horizontalAxis={yAxis}
bounds={innerBounds}
strokeWidth={axisLineWidth}
/>
{this.showLegend && (
<HorizontalCategoricalColorLegend manager={this} />
)}
Expand Down

0 comments on commit 2eeef9c

Please sign in to comment.