Skip to content

Commit a693467

Browse files
authored
Merge pull request #9 from Syphontwo/master
X Y coordinate values as percent
2 parents 9a64f17 + 1f12ac5 commit a693467

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/visual.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ module powerbi.extensibility.visual {
161161
for (var i = 0, len = this.dataPoints.length, p; i < len; i++) {
162162
p = this.dataPoints[i];
163163

164+
//"Syphontwo" Proposed Change
165+
//make it so the X and Y input values are a percentage
166+
//this means that the data collected is from 0 to 1 along each axis
167+
//multiply it by the current canvas size
168+
//this should keep the data scalable with the images and resizing
169+
p[0] = p[0] * this.width;
170+
p[1] = p[1] * this.height;
171+
//end proposed change
172+
164173
ctx.globalAlpha = Math.max(p[2] / this.maxValue, minOpacity === undefined ? 0.05 : minOpacity);
165174
ctx.drawImage(this.circle, p[0] - this.r, p[1] - this.r);
166175
}
@@ -471,4 +480,4 @@ module powerbi.extensibility.visual {
471480
return defaultValue;
472481
}
473482
}
474-
}
483+
}

0 commit comments

Comments
 (0)