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

FormatXLabel function is writing over the default x-axis values #374

Open
vaibhavvTripathi opened this issue Sep 19, 2024 · 1 comment
Open
Labels
question Further information is requested

Comments

@vaibhavvTripathi
Copy link

vaibhavvTripathi commented Sep 19, 2024

image

<CartesianChart
          data={weeklySalesArray}
          xKey="weeksAgo"
          yKeys={['revenue']}
          axisOptions={{
            font,
            formatXLabel: value => {
              return `${value} weeks ago`;
            },
            formatYLabel: value => {
              return `₹${value}`;
            },
            tickCount: 5,
          }}>
          {({points, chartBounds}) => (
            <Bar
              points={points.revenue}
              chartBounds={chartBounds}
              color="red"
              roundedCorners={{topLeft: 10, topRight: 10}}
              animate={{type: 'timing', duration: 2000}}>
              <LinearGradient
                start={vec(0, 0)}
                end={vec(0, 400)}
                colors={['green', '#90ee9050']}
              />
            </Bar>
          )}
        </CartesianChart>```
am i doing anything wrong in the configuration
@carbonrobot
Copy link
Contributor

Your code is correct, the text is overlapping because of the length. What is your expected output or design you are trying to achieve?

@carbonrobot carbonrobot added the question Further information is requested label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants