Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.

bug fix: Graph does not appear in the case of 0 (for IE8) #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions js/visualize.jQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,18 @@ $.fn.visualize = function(options, container){
//draw the pie pieces
$.each(memberTotals, function(i){
var fraction = (this <= 0 || isNaN(this))? 0 : this / dataSum;
ctx.beginPath();
ctx.moveTo(centerx, centery);
ctx.arc(centerx, centery, radius,
counter * Math.PI * 2 - Math.PI * 0.5,
(counter + fraction) * Math.PI * 2 - Math.PI * 0.5,
false);
ctx.lineTo(centerx, centery);
ctx.closePath();
ctx.fillStyle = dataGroups[i].color;
ctx.fill();
if(fraction > 0){
ctx.beginPath();
ctx.moveTo(centerx, centery);
ctx.arc(centerx, centery, radius,
counter * Math.PI * 2 - Math.PI * 0.5,
(counter + fraction) * Math.PI * 2 - Math.PI * 0.5,
false);
ctx.lineTo(centerx, centery);
ctx.closePath();
ctx.fillStyle = dataGroups[i].color;
ctx.fill();
}
// draw labels
var sliceMiddle = (counter + fraction/2);
var distance = o.pieLabelPos == 'inside' ? radius/1.5 : radius + radius / 5;
Expand Down Expand Up @@ -369,7 +371,10 @@ $.fn.visualize = function(options, container){
xVal += o.barGroupMargin*2;

ctx.moveTo(xVal, 0);
ctx.lineTo(xVal, Math.round(-points[i]*yScale));
var yVal = Math.round(-points[i]*yScale);
if(yVal < 0){
ctx.lineTo(xVal, yVal);
}
integer+=xInterval;
}
ctx.strokeStyle = dataGroups[h].color;
Expand Down