Most of methods should be virtual.
This commit is contained in:
parent
1d9912da49
commit
a73d81fc89
|
@ -77,7 +77,7 @@ namespace CairoChart {
|
||||||
public Line.Style line_style = Line.Style ();
|
public Line.Style line_style = Line.Style ();
|
||||||
public double font_indent = 5;
|
public double font_indent = 5;
|
||||||
|
|
||||||
public Axis copy () {
|
public virtual Axis copy () {
|
||||||
var axis = new Axis ();
|
var axis = new Axis ();
|
||||||
axis._date_format = this._date_format;
|
axis._date_format = this._date_format;
|
||||||
axis._dsec_signs = this._dsec_signs;
|
axis._dsec_signs = this._dsec_signs;
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace CairoChart {
|
||||||
|
|
||||||
public Line.Style line_style = Line.Style ();
|
public Line.Style line_style = Line.Style ();
|
||||||
|
|
||||||
public Grid copy () {
|
public virtual Grid copy () {
|
||||||
var grid = new Grid ();
|
var grid = new Grid ();
|
||||||
grid.color = this.color;
|
grid.color = this.color;
|
||||||
grid.line_style = this.line_style;
|
grid.line_style = this.line_style;
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace CairoChart {
|
||||||
public double text_vspace = 2.0;
|
public double text_vspace = 2.0;
|
||||||
public bool show = true;
|
public bool show = true;
|
||||||
|
|
||||||
public Legend copy () {
|
public virtual Legend copy () {
|
||||||
var legend = new Legend ();
|
var legend = new Legend ();
|
||||||
legend.position = this.position;
|
legend.position = this.position;
|
||||||
legend.font_style = this.font_style;
|
legend.font_style = this.font_style;
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace CairoChart {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Marker copy () {
|
public virtual Marker copy () {
|
||||||
return new Marker (type, size);
|
return new Marker (type, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace CairoChart {
|
||||||
public double zoom_y_min = 0;
|
public double zoom_y_min = 0;
|
||||||
public double zoom_y_max = 1;
|
public double zoom_y_max = 1;
|
||||||
|
|
||||||
public Place copy () {
|
public virtual Place copy () {
|
||||||
var place = new Place ();
|
var place = new Place ();
|
||||||
place.x_min = this.x_min;
|
place.x_min = this.x_min;
|
||||||
place.x_max = this.x_max;
|
place.x_max = this.x_max;
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace CairoChart {
|
||||||
|
|
||||||
public bool zoom_show = true;
|
public bool zoom_show = true;
|
||||||
|
|
||||||
public Series copy () {
|
public virtual Series copy () {
|
||||||
var series = new Series ();
|
var series = new Series ();
|
||||||
series._color = this._color;
|
series._color = this._color;
|
||||||
series.axis_x = this.axis_x.copy ();
|
series.axis_x = this.axis_x.copy ();
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
namespace CairoChart {
|
namespace CairoChart {
|
||||||
[Compact]
|
|
||||||
public class Text {
|
public class Text {
|
||||||
public string text = "";
|
public string text = "";
|
||||||
public Font.Style style = Font.Style ();
|
public Font.Style style = Font.Style ();
|
||||||
public Color color = Color();
|
public Color color = Color();
|
||||||
|
|
||||||
public Cairo.TextExtents get_extents (Cairo.Context context) {
|
public virtual Cairo.TextExtents get_extents (Cairo.Context context) {
|
||||||
context.select_font_face (style.family, style.slant, style.weight);
|
context.select_font_face (style.family, style.slant, style.weight);
|
||||||
context.set_font_size (style.size);
|
context.set_font_size (style.size);
|
||||||
Cairo.TextExtents extents;
|
Cairo.TextExtents extents;
|
||||||
|
@ -13,7 +12,7 @@ namespace CairoChart {
|
||||||
return extents;
|
return extents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double get_width (Cairo.Context context) {
|
public virtual double get_width (Cairo.Context context) {
|
||||||
var extents = get_extents (context);
|
var extents = get_extents (context);
|
||||||
switch (style.orientation) {
|
switch (style.orientation) {
|
||||||
case Font.Orientation.HORIZONTAL: return extents.width;
|
case Font.Orientation.HORIZONTAL: return extents.width;
|
||||||
|
@ -22,7 +21,7 @@ namespace CairoChart {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public double get_height (Cairo.Context context) {
|
public virtual double get_height (Cairo.Context context) {
|
||||||
var extents = get_extents (context);
|
var extents = get_extents (context);
|
||||||
switch (style.orientation) {
|
switch (style.orientation) {
|
||||||
case Font.Orientation.HORIZONTAL: return extents.height;
|
case Font.Orientation.HORIZONTAL: return extents.height;
|
||||||
|
@ -36,7 +35,7 @@ namespace CairoChart {
|
||||||
double height;
|
double height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Size get_size (Cairo.Context context) {
|
public virtual Size get_size (Cairo.Context context) {
|
||||||
var sz = Size();
|
var sz = Size();
|
||||||
var extents = get_extents (context);
|
var extents = get_extents (context);
|
||||||
switch (style.orientation) {
|
switch (style.orientation) {
|
||||||
|
@ -52,7 +51,7 @@ namespace CairoChart {
|
||||||
return sz;
|
return sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void show (Cairo.Context context) {
|
public virtual void show (Cairo.Context context) {
|
||||||
context.select_font_face(style.family,
|
context.select_font_face(style.family,
|
||||||
style.slant,
|
style.slant,
|
||||||
style.weight);
|
style.weight);
|
||||||
|
@ -74,7 +73,7 @@ namespace CairoChart {
|
||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Text copy () {
|
public virtual Text copy () {
|
||||||
var text = new Text ();
|
var text = new Text ();
|
||||||
text.text = this.text;
|
text.text = this.text;
|
||||||
text.style = this.style;
|
text.style = this.style;
|
||||||
|
|
Loading…
Reference in New Issue