Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line Chart data does not extend to full width of graph #725

Open
lmuller18 opened this issue Feb 24, 2024 · 1 comment
Open

Line Chart data does not extend to full width of graph #725

lmuller18 opened this issue Feb 24, 2024 · 1 comment

Comments

@lmuller18
Copy link

I am using a line chart and trying to fill the available space. I have checked that the graph itself is filling the container, but the data always seems to leave the final segment empty:

image
<LineChart
  data={{
    labels: [],
    datasets: [{ data: data.map((d) => d.y) }],
  }}
  bezier
  fromZero
  transparent
  width={width}
  height={200}
  chartConfig={{
    color: (opacity = 1) => `rgba(99, 102, 241, ${opacity})`,
  }}
  style={{
    paddingRight: 0,
    borderColor: "blue",
    borderWidth: 1,
  }}
/>

The same issue is seen when the padding isn't removed to hide the legend:

image

I am looking for a way to have the domain of the graph be exactly the domain of the data:

  • if there is only one data point, the data point is on the far left
  • if there are more than one data points, the last data point should be on the far right

Issue shown with 2 datapoints. The last data point is in the center instead of at the graphs full width

image
@laishere
Copy link

Duplicated #709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants