From 8e382fcb8462630ed536440f6502a48c3adb2c98 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 2 Jan 2025 15:46:20 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(discrete=20bar)=20hide=20horizonta?= =?UTF-8?q?l=20axis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/barCharts/DiscreteBarChart.tsx | 31 ++----------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx index 3f79cc7bdec..02d58aa5798 100644 --- a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx @@ -37,11 +37,7 @@ import { GRAPHER_AREA_OPACITY_DEFAULT, GRAPHER_FONT_SCALE_12, } from "../core/GrapherConstants" -import { - HorizontalAxisComponent, - HorizontalAxisGridLines, - HorizontalAxisZeroLine, -} from "../axis/AxisViews" +import { HorizontalAxisZeroLine } from "../axis/AxisViews" import { NoDataModal } from "../noDataModal/NoDataModal" import { AxisConfig, AxisManager } from "../axis/AxisConfig" import { ColorSchemes } from "../color/ColorSchemes" @@ -305,7 +301,6 @@ export class DiscreteBarChart @computed private get innerBounds(): Bounds { return this.boundsWithoutColorLegend .padLeft(Math.max(this.seriesLegendWidth, this.leftValueLabelWidth)) - .padBottom(this.showHorizontalAxis ? this.yAxis.height : 0) .padRight(this.rightValueLabelWidth) } @@ -350,10 +345,6 @@ export class DiscreteBarChart return this.barPlacements.map((b) => b.width) } - @computed private get showHorizontalAxis(): boolean | undefined { - return this.manager.isRelativeMode - } - private d3Bars(): Selection< BaseType, unknown, @@ -475,7 +466,6 @@ export class DiscreteBarChart width={series.barWidth} height={this.barHeight} fill={barColor} - opacity={GRAPHER_AREA_OPACITY_DEFAULT} style={{ transition: "height 200ms ease" }} /> ) @@ -504,7 +494,7 @@ export class DiscreteBarChart } renderChartArea(): React.ReactElement { - const { manager, boundsWithoutColorLegend, yAxis, innerBounds } = this + const { manager, yAxis, innerBounds } = this const axisLineWidth = manager.isStaticAndSmall ? GRAPHER_AXIS_LINE_WIDTH_THICK @@ -516,27 +506,12 @@ export class DiscreteBarChart {this.showColorLegend && ( )} - {this.showHorizontalAxis && ( - <> - - - - )} {!this.isLogScale && ( )} {this.renderBars()}