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

Bug regarding donut chart #1597

Closed
brijesh-imemori opened this issue Jul 1, 2024 · 6 comments
Closed

Bug regarding donut chart #1597

brijesh-imemori opened this issue Jul 1, 2024 · 6 comments

Comments

@brijesh-imemori
Copy link

image 1 :
image

image 2 :
image

As shown in the above images, we are using a donut chart in both the local and build environment on the server instance with all the development in place. However, the issue of an extra top value being added to the HTML content still persists. I am unsure where this extra top value is coming from. Please help us fix this bug.

@martynasma
Copy link
Collaborator

That doesn't look like something built-in. Would you be able to post your whole chart and data on CodePen/jsFiddle so that we can test?

@brijesh-imemori
Copy link
Author

https://codesandbox.io/p/sandbox/donut-chart-related-bug-cxw3hm?file=%2Fsrc%2FcircleChart%2FcircleChart.tsx%3A75%2C11

As you can see in the code above, this is how it works in the compiler. However, in our local environment without the compiler, it works fine.

Image 1:
image

The above image is from the inspect tool of the code in the compiler environment. You can see the top value is different.

Image 2:
image

The above image is from the inspect tool of the code in the local environment. Here, the top value is correct.

We found a temporary solution for now by adding dy: -30 inside the label in circleChart.tsx.

Repository owner deleted a comment from brijesh-imemori Jul 2, 2024
@martynasma
Copy link
Collaborator

I think the issue is that you have all those heights set, both in label settings and HTML styles. Try removing them.

@brijesh-imemori
Copy link
Author

https://codesandbox.io/p/sandbox/donut-chart-related-bug-cxw3hm?file=%2Fsrc%2FcircleChart%2FcircleChart.tsx%3A89%2C23

Now, as you can see, we removed all the HTML style, but the issue is still there. There is some extra top value added above the label.

@martynasma
Copy link
Collaborator

You still have height set in label's settings:

    const label = root.tooltipContainer.children.push(
      am5.Label.new(root, {
        html: htmlContent,
        position: "absolute",
        textAlign: "center",
        centerY: am5.percent(50),
        y: am5.percent(50),
        height: 10, // <- this
        x: am5.percent(50),
        centerX: am5.percent(50),
        fill: am5.color(0x8c8c8c),
      })
    );

Copy link

github-actions bot commented Aug 2, 2024

This issue is stale because it has been open 30 days with no activity. It will be closed in 5 days unless a new comment is added.

@github-actions github-actions bot added the stale label Aug 2, 2024
@github-actions github-actions bot closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants