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

Error when values go to zero (polar area) #5

Open
Shane98c opened this issue May 2, 2017 · 4 comments
Open

Error when values go to zero (polar area) #5

Shane98c opened this issue May 2, 2017 · 4 comments
Labels

Comments

@Shane98c
Copy link

Shane98c commented May 2, 2017

v0.2.2 on Leaflet v1.0.3

When all values go to zero in a polar area chart, I'm getting an error and odd animation behavior when changing values back to >0 (labels show and change size, but no area slices are shown.)

This is the error:

leaflet.minichart.min.js:4 Error: <g> attribute transform: Expected number, "translate(NaN,NaN)".

image

Thanks again for making this available!

@FrancoisGuillem
Copy link
Contributor

This should be solved now. The problem occured when option maxValues (maximal absolute value that data could take) was not set explicitely. In such case, the chart instance used the maximal value of its data and this resulted in a "0 / 0" problem.

Anyway, even if maxValues is optional, you should always set it to avoid problems.

@Shane98c
Copy link
Author

Shane98c commented May 4, 2017

My data have highly varied magnitudes, and I'm not interested in comparing their exact values across charts, just the proportions. When I supply a maxValue, I end up with the issues in the below gif. In the updated dev version, this now happens whether or not I set this maxValue.

Let me know if there is anything else I should try!

progress444

@FrancoisGuillem
Copy link
Contributor

If you want to represent proportions, why don't you use pie charts instead of polar area chart? If you really want to use polar charts, you should set maxValues to the max of the five values.

Your application looks nice. Do you plan to publish it? If so, could I use it as an example of usage in the documentation?

@Shane98c
Copy link
Author

@FrancoisGuillem thanks for the kind words! Sorry I've been away from this for so long. You can definitely use the app as an example. I probably won't have a chance to complete the app and get it onto app stores very soon, but I would like to eventually. It lives in this repository: https://github.com/Shane98c/multigeovis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants