In progress...

This commit is contained in:
Kolan Sh 2018-01-21 15:36:08 +03:00
parent 67a8067bd4
commit d9f79241dc
1 changed files with 27 additions and 3 deletions

View File

@ -1,9 +1,15 @@
namespace CairoChart { namespace CairoChart {
/**
* {@link Series} Marker.
*/
public class Marker { public class Marker {
/**
* ``Marker`` shape.
*/
public enum Type { public enum Type {
NONE = 0, // default NONE = 0,
SQUARE, SQUARE,
CIRCLE, CIRCLE,
TRIANGLE, TRIANGLE,
@ -12,9 +18,21 @@ namespace CairoChart {
PRICLE_TRIANGLE PRICLE_TRIANGLE
} }
/**
* ``Marker`` shape.
*/
public Type type = Type.NONE; public Type type = Type.NONE;
/**
* ``Marker`` size.
*/
public double size = 8.0; public double size = 8.0;
/**
* Constructs a new ``Marker``.
* @param type ``Marker`` shape.
* @param size ``Marker`` size.
*/
public Marker (Type type = Type.NONE, public Marker (Type type = Type.NONE,
double size = 8.0 double size = 8.0
) { ) {
@ -22,10 +40,18 @@ namespace CairoChart {
this.size = size; this.size = size;
} }
/**
* Gets a copy of the ``Marker``.
*/
public virtual Marker copy () { public virtual Marker copy () {
return new Marker (type, size); return new Marker (type, size);
} }
/**
* Draws the ``Marker`` at specific position.
* @param x x-coordinate.
* @param y y-coordinate.
*/
public virtual void draw_at_pos (Chart chart, double x, double y) { public virtual void draw_at_pos (Chart chart, double x, double y) {
chart.ctx.move_to (x, y); chart.ctx.move_to (x, y);
switch (type) { switch (type) {
@ -69,5 +95,3 @@ namespace CairoChart {
} }
} }
} }