mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Merge pull request #402 from nnnick/fix/point-dot-option
Fix option for pointDot not being obeyed
This commit is contained in:
commit
a55fdaad57
26
Chart.js
vendored
26
Chart.js
vendored
@ -1042,25 +1042,27 @@
|
||||
|
||||
|
||||
Chart.Point = Chart.Element.extend({
|
||||
inRange : function(chartX,chartY){
|
||||
display: true,
|
||||
inRange: function(chartX,chartY){
|
||||
var hitDetectionRange = this.hitDetectionRadius + this.radius;
|
||||
return ((Math.pow(chartX-this.x, 2)+Math.pow(chartY-this.y, 2)) < Math.pow(hitDetectionRange,2));
|
||||
},
|
||||
draw : function(){
|
||||
var ctx = this.ctx;
|
||||
ctx.beginPath();
|
||||
if (this.display){
|
||||
var ctx = this.ctx;
|
||||
ctx.beginPath();
|
||||
|
||||
ctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);
|
||||
ctx.closePath();
|
||||
ctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);
|
||||
ctx.closePath();
|
||||
|
||||
ctx.strokeStyle = this.strokeColor;
|
||||
ctx.lineWidth = this.strokeWidth;
|
||||
ctx.strokeStyle = this.strokeColor;
|
||||
ctx.lineWidth = this.strokeWidth;
|
||||
|
||||
ctx.fillStyle = this.fillColor;
|
||||
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.fillStyle = this.fillColor;
|
||||
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
|
||||
//Quick debug for bezier curve splining
|
||||
@ -2419,6 +2421,7 @@
|
||||
this.PointClass = Chart.Point.extend({
|
||||
strokeWidth : this.options.pointDotStrokeWidth,
|
||||
radius : this.options.pointDotRadius,
|
||||
display: this.options.pointDot,
|
||||
hitDetectionRadius : this.options.pointHitDetectionRadius,
|
||||
ctx : this.chart.ctx,
|
||||
inRange : function(mouseX){
|
||||
@ -3023,6 +3026,7 @@
|
||||
this.PointClass = Chart.Point.extend({
|
||||
strokeWidth : this.options.pointDotStrokeWidth,
|
||||
radius : this.options.pointDotRadius,
|
||||
display: this.options.pointDot,
|
||||
hitDetectionRadius : this.options.pointHitDetectionRadius,
|
||||
ctx : this.chart.ctx
|
||||
});
|
||||
|
||||
4
Chart.min.js
vendored
4
Chart.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1042,25 +1042,27 @@
|
||||
|
||||
|
||||
Chart.Point = Chart.Element.extend({
|
||||
inRange : function(chartX,chartY){
|
||||
display: true,
|
||||
inRange: function(chartX,chartY){
|
||||
var hitDetectionRange = this.hitDetectionRadius + this.radius;
|
||||
return ((Math.pow(chartX-this.x, 2)+Math.pow(chartY-this.y, 2)) < Math.pow(hitDetectionRange,2));
|
||||
},
|
||||
draw : function(){
|
||||
var ctx = this.ctx;
|
||||
ctx.beginPath();
|
||||
if (this.display){
|
||||
var ctx = this.ctx;
|
||||
ctx.beginPath();
|
||||
|
||||
ctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);
|
||||
ctx.closePath();
|
||||
ctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);
|
||||
ctx.closePath();
|
||||
|
||||
ctx.strokeStyle = this.strokeColor;
|
||||
ctx.lineWidth = this.strokeWidth;
|
||||
ctx.strokeStyle = this.strokeColor;
|
||||
ctx.lineWidth = this.strokeWidth;
|
||||
|
||||
ctx.fillStyle = this.fillColor;
|
||||
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.fillStyle = this.fillColor;
|
||||
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
|
||||
//Quick debug for bezier curve splining
|
||||
|
||||
@ -57,6 +57,7 @@
|
||||
this.PointClass = Chart.Point.extend({
|
||||
strokeWidth : this.options.pointDotStrokeWidth,
|
||||
radius : this.options.pointDotRadius,
|
||||
display: this.options.pointDot,
|
||||
hitDetectionRadius : this.options.pointHitDetectionRadius,
|
||||
ctx : this.chart.ctx,
|
||||
inRange : function(mouseX){
|
||||
|
||||
@ -70,6 +70,7 @@
|
||||
this.PointClass = Chart.Point.extend({
|
||||
strokeWidth : this.options.pointDotStrokeWidth,
|
||||
radius : this.options.pointDotRadius,
|
||||
display: this.options.pointDot,
|
||||
hitDetectionRadius : this.options.pointHitDetectionRadius,
|
||||
ctx : this.chart.ctx
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user