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

to display zero on the label, not 'undefined' #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

to display zero on the label, not 'undefined' #23

wants to merge 1 commit into from

Conversation

sazanof
Copy link

@sazanof sazanof commented Mar 22, 2018

No description provided.

@lucbu
Copy link

lucbu commented Apr 26, 2018

I don't think this is a good idea, we may want to know if the value is undefined ?

@jeminriotlysocial
Copy link

Hi @lucbu @sazanof,

I am also facing this issue. I as of now we should allow this change. Because zero a value is the very high chance then undefined as a value.

Else we should do special handling for zero or undefined.

Thanks. Will be very happy if we merge this request.

@catsofmath
Copy link

I think we should do special handling, where zero is a treated as a number and undefined is treated with special care

@jeminriotlysocial
Copy link

plugins: [ Chartist.plugins.ctPointLabels({ textAnchor: 'middle', labelInterpolationFnc: (value) => { alert("called" + value); if (typeof value === "undefined") return "0"; else return value; } }) ]

I did solve this using a passing function labelInterpolationFnc: This function will be called before it display a lable you can as per your login. Hope this helps.

@barsanayak
Copy link

Thank you so much jeminriotlysocial , You saved me hell lot of a time

@LuizAntonioJR-RJ
Copy link

plugins: [ Chartist.plugins.ctPointLabels({ textAnchor: 'middle', labelInterpolationFnc: (value) => { alert("called" + value); if (typeof value === "undefined") return "0"; else return value; } }) ]

I did solve this using a passing function labelInterpolationFnc: This function will be called before it display a lable you can as per your login. Hope this helps.

Thanks for your help. Helped me a lot !!!

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

Successfully merging this pull request may close these issues.

6 participants