소스 검색

Scatter line width

tentone 5 년 전
부모
커밋
3eb37fb782
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 3
      source/objects/chart/Graph.js
  2. 2 1
      source/objects/chart/ScatterGraph.js

+ 2 - 3
source/objects/chart/Graph.js

@@ -26,9 +26,9 @@ function Graph()
 	this.strokeStyle = new ColorStyle("rgb(0, 153, 255)");
 
 	/**
-	 * Line width.
+	 * Line width used to stroke the graph data.
 	 */
-	this.lineWidth = 1;
+	this.lineWidth = 1.0;
 
 	/**
 	 * Background color of the box.
@@ -74,7 +74,6 @@ Graph.prototype.draw = function(context, viewport, canvas)
 	var height = this.box.max.y - this.box.min.y;
 
 	context.lineWidth = this.lineWidth;
-
 	context.beginPath();
 			
 	var step = width / (this.data.length - 1);

+ 2 - 1
source/objects/chart/ScatterGraph.js

@@ -14,7 +14,7 @@ function ScatterGraph()
 	/**
 	 * Radius of each point represented in the scatter plot.
 	 */
-	this.radius = 1.0;
+	this.radius = 3.0;
 }
 
 ScatterGraph.prototype = Object.create(Graph.prototype);
@@ -35,6 +35,7 @@ ScatterGraph.prototype.draw = function(context, viewport, canvas)
 	var step = width / (this.data.length - 1);
 	var gamma = this.max - this.min;
 
+	context.lineWidth = this.lineWidth;
 	context.beginPath();
 
 	for(var i = 0, s = step; i < this.data.length; s += step, i++)