This specific section contains an image positioned at the top, followed by two other components (within <ItemsContainer/>
) at the bottom which display as separate rows. I am trying to place these two items (a grid and a chart) side by side within the same row. Despite attempting to adjust the flex direction, it does not seem to be working as expected. This may be due to the existing flex-direction: column;
in the parent component.
<main className='content'>
<img src={poly} alt="charts" className="charts" />
<div className="heading">
Heading Text
</div>
<span> The text goes here. </span>
<div className="regressionSetup"&rt;
<ItemsContainer/>
</div>
</main>
.content{
padding-left: 260px;
padding-top: 100px;
display: flex;
flex-direction: column;
background-color: white;
}
.popup{
padding-bottom: 20px;
}
.charts{
align-self: center;
height: 350px;
width: 800px;
}
.heading{
font-size: 25px;
}
.regressionSetup{
flex-direction: row;
}
https://i.sstatic.net/vnCkW.png
ItemsContainer:
return(
<div className="container">
<PointDrawer addCoord={this.addCoord.bind(this)}
resetCoords={this.resetCoords.bind(this)}/>
<RegressionSetup
order_graph_1={this.state.order_graph_1}
order_graph_2={this.state.order_graph_2}
setOrders={(orders: any) => this.setState(orders)}
/>
<Graph x={this.state.x_array} y={this.state.y_array}
deg={this.state.order_graph_1} width={800}
color={this.color_graph_1} />
</div>)
css
.container {
background-color: red;
width: 100vw;
flex-direction: row;
}
Is there a way to correctly align the grid on the left and the chart on the right within the same line/row?