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

Doughnut tooltips displayColors problem #4741

Closed
officinainformatica opened this issue Sep 11, 2017 · 11 comments
Closed

Doughnut tooltips displayColors problem #4741

officinainformatica opened this issue Sep 11, 2017 · 11 comments

Comments

@officinainformatica
Copy link

officinainformatica commented Sep 11, 2017

After the upgrade to 2.7 I found a bug.
When the option displayColors: false is set the text color of tooltips are black.
I tryed to set the bodyFontColor: '#ffffff', etc but the color text on the tooltips are always black.

this is my code:

var myChart	 = new Chart(ctx, {
    type: 'doughnut',
    data: data<?php echo $grafico_key; ?>,
    options: {
        responsive: true,
        maintainAspectRatio: false,
        animation: {
            duration: 2000,
        },
        legend: {
            display: false
        },
        tooltips: {
            mode: 'label',
            position: 'nearest',
            xPadding: 10,
            yPadding: 10,
            bodyFontSize: 15,
            bodySpacing: 8,
            caretSize: 10, //freccetta
            displayColors: false,
            bodyFontColor: '#fff',
            callbacks: {
                label: function(tooltipItem, data) {
                    var valore = aggiungiPercento(data.datasets[0].data[tooltipItem.index].toString().trim());
                    return (data.labels[tooltipItem.index] + ": " + valore);
                },
                labelTextColor: function(tooltipItem, chart) {
                    return '#ffffff';
                }
            }
        }
    }
}); 

Edit (SB): code formatting

@vinicius33
Copy link

+1. Same problem here. :/

@simonbrunel
Copy link
Member

@officinainformatica @infodark can one of you build a jsfiddle that reproduce this issue?

@officinainformatica
Copy link
Author

Is the first time with jsfiddle but I try
https://jsfiddle.net/48so5r63/

@simonbrunel
Copy link
Member

You need to use https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.bundle.js for the fiddle to work.

@simonbrunel
Copy link
Member

Can reproduce this issue (fiddle), introduced by #4199.

@simonbrunel simonbrunel added this to the Version 2.8 milestone Sep 11, 2017
@yusufozturk
Copy link

This is a breaking change. We need to enable displayColors to make "tooltip" visible. I think this should be on documentation or update notes for 2.7.

I hope you can fix this on 2.7.1.

@etimberg
Copy link
Member

I'm happy to review a PR for fixing this if someone has it.

@EmilMoe
Copy link

EmilMoe commented Sep 29, 2017

What is the roadmap to this fix? (Days, weeks, months) I'm still building for development, but in a couple of months it needs to go into production.

@etimberg
Copy link
Member

@EmilMoe #4766 has a fix for this

@EmilMoe
Copy link

EmilMoe commented Sep 29, 2017

Thanks @etimberg I will stay standby for now then

@etimberg
Copy link
Member

etimberg commented Oct 2, 2017

Done in #4783

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

6 participants