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

Still blacked text and background color on tooltips. #5012

Closed
mbsaberi opened this issue Nov 30, 2017 · 9 comments
Closed

Still blacked text and background color on tooltips. #5012

mbsaberi opened this issue Nov 30, 2017 · 9 comments

Comments

@mbsaberi
Copy link

[BUG]
Hi. On my project, tooltip text and background color are both blacked. Texts are not readable, and any of my changes could not solve the problem.
I've checked different solutions mentioned in #4766, #4741, #4783, and ... But none of them could not solve my problem. I am using the latest version of Chart.js. Also I've test it in both Chrome and Firefox.

untitled-3

@jcopperfield
Copy link
Contributor

@MBSmt could you provide a jsfiddle that demonstrates the example?

@mbsaberi
Copy link
Author

@jcopperfield it's really strange. It worked well without any issue out of my project.
https://jsfiddle.net/a6uqexmw/2/

What might be happened that caused the problem?
Compare the jsfiddle above with this new snapshot ...
untitled-1

@jcopperfield
Copy link
Contributor

@MBSmt I think you might have a local problem with your browsers.
issue-5012-black-tooltip-text

@mbsaberi
Copy link
Author

@jcopperfield I tested it with Chrom, Firefox, IE. All of them have that problem!

@simonbrunel
Copy link
Member

What version of Chart.js are you using, I think it's a bug fixed in 2.7.1 (#4783)

@jcopperfield
Copy link
Contributor

@MBSmt Might be a driver problem. Your fiddle doesn't recreate the bug for me.

@mbsaberi
Copy link
Author

@simonbrunel It's 2.7.1, the latest version. I tested it outside my project in a standalone html file, and it worked without any problem. I had to remove all included CSS and JS files one by one from my project and finally I found a conflict between Chart.js and Persianumber.js.

@jcopperfield
Copy link
Contributor

@MBSmt it seems like Persianumber.js overwrites the parseInt and parseFloat functions. This is not good practice. However if you the problem is that the parseInt implementation doesn't include the radix argument, which causes the problem.
You can either remove the parseInt and parseFloat functions from the Persianumber.js or you should add the radix argument to parseInt, like shown below.

origParseInt = parseInt;
parseInt = function(str, radix) {
    str = str && str.toString().replace(/[\u06F0\u06F1\u06F2\u06F3\u06F4\u06F5\u06F6\u06F7\u06F8\u06F9]/g, function(v){return String.fromCharCode(v.charCodeAt(0) - 1728)}).replace(/[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]/g, function(v){return String.fromCharCode(v.charCodeAt(0) - 1584)}).replace(/[\u066B]/g, '.');
    return origParseInt(str, radix);
};

@mbsaberi
Copy link
Author

mbsaberi commented Dec 1, 2017

@jcopperfield That's it... You solved my problem. Thank you and all other guys.

@mbsaberi mbsaberi closed this as completed Dec 1, 2017
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