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

Tooltip is not showing #111

Open
mbasakCinedigmInd opened this issue May 31, 2023 · 5 comments
Open

Tooltip is not showing #111

mbasakCinedigmInd opened this issue May 31, 2023 · 5 comments

Comments

@mbasakCinedigmInd
Copy link

Tooltip is not showing

Using you current version of sunburst chart and i do not know why the tooltip on hover chart is not showing. i used the following code. please let me know how can i fix this...

let chart = Sunburst();
chart
.data(data)
.width(740)
.height(740)
.color((d) => d.color)
.showTooltip(() => true)
.tooltipContent((d) => Notes: <i>${d.name} </i>)
.excludeRoot(true)(document.getElementById("chart-sunburst"+chartFor));

i am using the sample data and added color to it

@abhijitakulkarni
Copy link

Hi, were you able to resolve this, i am facing the same issue ? @vasturiano do you have any idea what i am missing, this is my code :

const sbdata = {
      name: 'main',
      color: 'magenta',
      children: [
        {
          name: 'a',
          size: 1,
          value: 20,
        },
        {
          name: 'b',
          children: [
            {
              name: 'ba',
              size: 1,
              value: 89
            },
            {
              name: 'bb',
              children: [
                {
                  name: 'bba',
                  size: 1,
                  value: 77
                },
                {
                  name: 'bbb',
                  size: 1,
                  value: 55
                }
              ]
            }
          ]
        }
      ]
    };

    Sunburst()
      .data(sbdata)
      .size('size')
      .height(150)
      .showLabels(true)
      .showTooltip(()=> true)
      .tooltipTitle(()=>'my title')
      .tooltipContent((d, node) => `Size: <i>${node.value}</i>`)
      .color(d => color(d.name))(this.sbChartEl.nativeElement);

@mbasakCinedigmInd
Copy link
Author

No i couldnt resolve this, tooltip is coming but somehow getting hidden.... or getting beneath the graph itself. not sure how to solve it

@abhijitakulkarni
Copy link

hmm, i could see the div element in the dom for toopltip, but does not shows up

@vasturiano
Copy link
Owner

Do you observe the same issue in the built-in example? https://vasturiano.github.io/sunburst-chart/example/flare/

If not, could you make a simple reproducible example on https://codesandbox.io/ so that we can have a closer look?

@abhijitakulkarni
Copy link

abhijitakulkarni commented Jul 7, 2023

Ok so i figured out the problem, when i tried replicating the issue in sandbox, i did not come across the issue. the problem in my case was the .tooltip class coming from bootstrap overriding the properties coming from the library (same class names) and it had opacity: 0 property because of which the tooltip class was hidden. I had to set the property in my global styles, to override it :

 .tooltip {
    opacity: 1 !important;
 }

Thanks for the idea @vasturiano

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

3 participants