diff --git a/src/Area.vala b/src/Area.vala index d912cc9..e1e641d 100644 --- a/src/Area.vala +++ b/src/Area.vala @@ -72,7 +72,8 @@ namespace CairoChart { * @param x1 right bound. * @param y1 bottom bound. */ - public Area.with_abs (double x0, double y0, double x1, double y1) { + public Area.with_abs (double x0, double y0, + double x1, double y1) { this.x0 = x0; this.y0 = y0; this.x1 = x1; @@ -98,7 +99,8 @@ namespace CairoChart { * @param width ``Area`` width. * @param height ``Area`` height. */ - public Area.with_rel (double x0, double y0, double width, double height) { + public Area.with_rel (double x0, double y0, + double width, double height) { this.x0 = x0; this.y0 = y0; this.width = width; diff --git a/src/Marker.vala b/src/Marker.vala index e3a5825..0d35ec6 100644 --- a/src/Marker.vala +++ b/src/Marker.vala @@ -23,7 +23,7 @@ namespace CairoChart { /** * ``Marker`` shape. */ - public Shape type; + public Shape shape; /** * ``Marker`` size. @@ -33,15 +33,15 @@ namespace CairoChart { /** * Constructs a new ``Marker``. * @param chart ``Chart`` instance. - * @param type ``Marker`` shape. + * @param shape ``Marker`` shape. * @param size ``Marker`` size. */ public Marker (Chart chart, - Shape type = Shape.NONE, + Shape shape = Shape.NONE, double size = 8.0 ) { this.chart = chart; - this.type = type; + this.shape = shape; this.size = size; } @@ -49,7 +49,7 @@ namespace CairoChart { * Gets a copy of the ``Marker``. */ public virtual Marker copy () { - return new Marker (chart, type, size); + return new Marker (chart, shape, size); } /** @@ -58,7 +58,7 @@ namespace CairoChart { */ public virtual void draw_at_pos (Point p) { chart.ctx.move_to (p.x, p.y); - switch (type) { + switch (shape) { case Shape.SQUARE: chart.ctx.rectangle (p.x - size / 2, p.y - size / 2, size, size); chart.ctx.fill(); diff --git a/test/ChartTest.vala b/test/ChartTest.vala index 3347319..30ac119 100644 --- a/test/ChartTest.vala +++ b/test/ChartTest.vala @@ -31,9 +31,9 @@ void plot_chart1 (Chart chart) { s3.place.x0 = 0; s3.place.x1 = 0.5; s3.place.y0 = 0.5; s3.place.y1 = 1.0; - s1.marker.type = Marker.Shape.SQUARE; - s2.marker.type = Marker.Shape.CIRCLE; - s3.marker.type = Marker.Shape.PRICLE_TRIANGLE; + s1.marker.shape = Marker.Shape.SQUARE; + s2.marker.shape = Marker.Shape.CIRCLE; + s3.marker.shape = Marker.Shape.PRICLE_TRIANGLE; s1.axis_x.title = new Text(chart, "Series 1: Axis X."); s1.axis_y.title = new Text(chart, "Series 1: Axis Y."); @@ -103,9 +103,9 @@ void plot_chart2 (Chart chart) { s3.place.x0 = 0.0; s3.place.x1 = 1.0; s3.place.y0 = 0.5; s3.place.y1 = 1.0; - s1.marker.type = Marker.Shape.PRICLE_CIRCLE; - s2.marker.type = Marker.Shape.PRICLE_SQUARE; - s3.marker.type = Marker.Shape.SQUARE; + s1.marker.shape = Marker.Shape.PRICLE_CIRCLE; + s2.marker.shape = Marker.Shape.PRICLE_SQUARE; + s3.marker.shape = Marker.Shape.SQUARE; s1.axis_x.title = new Text(chart, "All Series: Axis X."); s1.axis_y.title = new Text(chart, "Series 1: Axis Y."); @@ -153,9 +153,9 @@ void plot_chart3 (Chart chart) { s3.place.x0 = 0; s3.place.x1 = 0.5; s3.place.y0 = 0.0; s3.place.y1 = 1.0; - s1.marker.type = Marker.Shape.SQUARE; - s2.marker.type = Marker.Shape.PRICLE_CIRCLE; - s3.marker.type = Marker.Shape.TRIANGLE; + s1.marker.shape = Marker.Shape.SQUARE; + s2.marker.shape = Marker.Shape.PRICLE_CIRCLE; + s3.marker.shape = Marker.Shape.TRIANGLE; s1.axis_x.title = new Text(chart, "Series 1: Axis X."); s1.axis_y.title = new Text(chart, "All Series: Axis Y."); @@ -217,10 +217,10 @@ void plot_chart4 (Chart chart) { s4.place.x0 = 0.2; s4.place.x1 = 1.0; s4.place.y0 = 0.0; s4.place.y1 = 1.0; - s1.marker.type = Marker.Shape.SQUARE; - s2.marker.type = Marker.Shape.PRICLE_CIRCLE; - s3.marker.type = Marker.Shape.TRIANGLE; - s4.marker.type = Marker.Shape.PRICLE_SQUARE; + s1.marker.shape = Marker.Shape.SQUARE; + s2.marker.shape = Marker.Shape.PRICLE_CIRCLE; + s3.marker.shape = Marker.Shape.TRIANGLE; + s4.marker.shape = Marker.Shape.PRICLE_SQUARE; s1.axis_x.title = new Text(chart, "Series 1: Axis X."); s1.axis_y.title = new Text(chart, "All Series: Axis Y.");