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

xAxis labels are not truncated and cut off #590

Open
yubinjodev opened this issue Apr 2, 2024 · 1 comment
Open

xAxis labels are not truncated and cut off #590

yubinjodev opened this issue Apr 2, 2024 · 1 comment

Comments

@yubinjodev
Copy link

image
image

https://apexcharts.com/docs/multiline-text-and-line-breaks-in-axes-labels/
According to documentation, it says the following

labels are then truncated if it overflows the region

However, they are not in this case. As you can see, the xAxis label for the first value is cut off. I have tried setting the parent element to overflow-x: visible, to at least show the values even if it is not truncated, which does not work again.

How do I make the values truncate or at least overflow the xAxis labels?

@yubinjodev
Copy link
Author

Here's my options

const options: ApexOptions = {
   colors,
   series: filterData,
   chart: {
     type: 'line',
   },
   dataLabels: {
     enabled: true,
   },

   xaxis: {
     categories: xAxis,
     labels: {
       show: true,
       showDuplicates: false,
     },
   },
   yaxis: filterData.map(() => {
     return { show: false }
   }),
   tooltip: {
     fixed: {
       enabled: true,
       position: 'topLeft',
       offsetY: 30,
       offsetX: 60,
     },
   },
 }

I have also tried the following, but it still cuts off the values
image

xaxis: {
      categories: xAxis.map((label) => label.replace(/-/g, '/').split(' ')),
      labels: {
        show: true,
        rotate: 0,
        showDuplicates: false,
      },
    },

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

1 participant