I am using Recharts and have a component that displays a line chart followed by a bar chart. The two charts are displaying the same seven day span, but the ticks are not aligned. The line chart starts on the Y Axis line, while the bar chart has left padding (by default).
On the line chart I tried adding padding={{left: 100 }}, which got the starting of the X axes aligned, but the rest of the ticks were off, and more importantly it isn't responsive to the screen size. As far as I can tell using something like '5%' is not allowed.
On the bar chart I tried setting the padding to zero and a negative number, but ran into the same issues with responsive scaling and tick misalignment.
Is there a way to align the ticks and data on the two graphs?
Here is the code:
<ResponsiveContainer width="95%" height={300} >
<LineChart width={350} height={300} data={this.props.data.activityResponse.edges} connectNulls={true} >
<Legend verticalAlign="top" height={36}/>
<Line type="monotone" dataKey="node.participation" stroke={this.participationColor} name="Participation" strokeWidth={this.strokeWidth} />
<Line type="monotone" dataKey="node.focus" stroke={this.focusColor} name="Focus" strokeWidth={this.strokeWidth} />
<XAxis dataKey="node.logDate" tickFormatter={this.formatXAxis} />
<YAxis dataKey="node.participation" >
<Label value="%" position="insideLeft" />
</YAxis>
<Tooltip content={this.renderResponseTooltip} />
</LineChart>
</ResponsiveContainer>
<ResponsiveContainer width="95%" height={300} >
<BarChart width={350} height={300} data={this.props.data.activityStep.edges} connectNulls={true} >
<Legend verticalAlign="top" height={36}/>
<Bar dataKey="node.stepCount" fill={this.stepColor} name="Steps" />
<XAxis dataKey="node.logDate" tickFormatter={this.formatXAxis} />
<YAxis dataKey="node.stepCount" >
</YAxis>
<Tooltip content={this.renderStepTooltip} />
</BarChart>
</ResponsiveContainer>


