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 isn't displayed when the first series is hidden #85

Closed
rzds opened this issue Sep 12, 2018 · 7 comments
Closed

Tooltip isn't displayed when the first series is hidden #85

rzds opened this issue Sep 12, 2018 · 7 comments
Labels
bug Something isn't working

Comments

@rzds
Copy link

rzds commented Sep 12, 2018

I only tested this on a stacked area chart. I used 2 versions of apexcharts.js:

CDN: I've noticed that only when you hide the first series (Series A in the example below) the tooltip doesn't show anymore.
https://codepen.io/anon/pen/rZdgKv

Downloaded version: The tooltip shows but there is a problem on the first day of the interval because the x parameter in the formatter function is undefined.

title

tooltip: {    
        x: {    
            formatter: function (x) {
                if(typeof x==='undefined') {
                     return null;
                 } else {
                     return new Date(x).toCustomFormat();
                 }           
            }
        }
    }
@junedchhipa
Copy link
Contributor

Thanks for reporting.
Yes, since 1.4.11 - I see that the tooltip doesn't behave correctly when series is shown/hide with the legend interaction.

I will also test with the custom tooltip.x.formatter function which you provided.

@junedchhipa
Copy link
Contributor

Fixed it.

But couldn't reproduce the issue for tooltip.x.formatter which you mentioned. I don't get x = undefined when I hide the first series.

Please create a codepen with that issue so I can see what data you are using if the issue still persists after this patch.

@rzds
Copy link
Author

rzds commented Sep 12, 2018

Thanks for the fix.
I just checked and the version available for download (the one with the formatter bug) is 1.0.0. Way too old. Maybe someone could put a newer version on apexcharts site.

@junedchhipa
Copy link
Contributor

junedchhipa commented Sep 12, 2018

No worries.
I will upload the latest version on the website.

@rzds
Copy link
Author

rzds commented Sep 12, 2018

Awesome.
Can you check it now with the latest version on cdn? Just go to "Sep 6" after you hide Serie A. You'll see there's no date displayed in that tooltip.
https://codepen.io/anon/pen/rZdgKv

@rzds
Copy link
Author

rzds commented Sep 12, 2018

I did some more tests.
When I zoomed out this happens.
a1

But when I move the mouse just a little...
a2

Maybe this helps.

@junedchhipa
Copy link
Contributor

Indeed, it will help.
Thanks for providing extra details!

@junedchhipa junedchhipa reopened this Sep 12, 2018
@junedchhipa junedchhipa added the bug Something isn't working label Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants