-
Notifications
You must be signed in to change notification settings - Fork 203
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
Showing percentages are wrong #53
Comments
Today I ran into the same problem. I decided it follows, I replaced the floor method to method round. And everything started working fine! |
Hey! Yes, it may not always add up to 100% due to rounding issues. @patil-nileshb committed a fix which will ensure the Once the next release is available you'll be able to use the |
Hi, iron-viper, what change I have to implement in d3pie.min.js to solve problem |
Hi, pramilkprince. Replace: |
The segment percentages showing on d3pie chart is wrong ,because the sum of percentage is not 100%. The configuration object developed by d3pie generator is given below.
var pie = new d3pie("pieChart", {
"header": {
"title": {
"fontSize": 34,
"font": "courier"
},
"subtitle": {
"color": "#999999",
"fontSize": 10,
"font": "courier"
},
"location": "pie-center",
"titleSubtitlePadding": 10
},
"footer": {
"color": "#999999",
"fontSize": 10,
"font": "open sans",
"location": "bottom-left"
},
"size": {
"canvasWidth": 642,
"pieInnerRadius": "52%",
"pieOuterRadius": "70%"
},
"data": {
"sortOrder": "label-desc",
"content": [
{
"label": "green",
"value": 3,
"color": "#2fc339"
},
{
"label": "Donald Rumsfeld",
"value": 4,
"color": "#eb2da5"
},
{
"label": "The Zombie Apocalypse",
"value": 4,
"color": "#cb2121"
},
{
"label": "Planes with/out snakes",
"value": 5,
"color": "#ae83d5"
}
]
},
"labels": {
"outer": {
"format": "label-percentage1",
"pieDistance": 3
},
"mainLabel": {
"fontSize": 11
},
"percentage": {
"color": "#100d0d",
"fontSize": 11,
"decimalPlaces": 0
},
"value": {
"color": "#cc8143",
"fontSize": 11
},
"lines": {
"enabled": true
}
},
"tooltips": {
"enabled": true,
"type": "placeholder",
"string": "{label}: {value}, {percentage}%",
"styles": {
"fadeInSpeed": 121
}
},
"effects": {
"pullOutSegmentOnClick": {
"effect": "linear",
"speed": 400,
"size": 8
}
},
"misc": {
"colors": {
"segmentStroke": "#000000"
}
}
});
The following figure shows the total percentage is 99%
The text was updated successfully, but these errors were encountered: