diff --git a/src/Axis.vala b/src/Axis.vala index 2bf64b4..44f9f78 100644 --- a/src/Axis.vala +++ b/src/Axis.vala @@ -1,23 +1,61 @@ namespace CairoChart { /** - * + * ``Chart`` axis. */ public class Axis { - public Range range = new Range(); + Chart chart; public Text title; + + /** + * ``Axis`` range/limits. + */ + public Range range = new Range(); + + /** + * Data type. + */ public enum DType { + /** + * Float128 numbers. + */ NUMBERS = 0, + + /** + * Date/Time. + */ DATE_TIME } - public enum ScaleType { - LINEAR = 0, // default - // LOGARITHMIC, // TODO - // etc - } + + /** + * Data type. + */ public DType dtype; + + /** + * ``Axis`` scale type. + */ + public enum ScaleType { + /** + * Linear scale. + */ + LINEAR = 0, + + /** + * Logarithmic scale. + */ + // LOGARITHMIC, + } + + /** + * Scale type. + */ public ScaleType scale_type; + + /** + * ``Axis`` position. + */ public enum Position { LOW = 0, HIGH = 1, @@ -66,6 +104,11 @@ namespace CairoChart { public LineStyle line_style = LineStyle (); public double font_spacing = 5; + public Axis (Chart chart) { + this.chart = chart; + title = new Text (chart, ""); + } + public virtual Axis copy () { var axis = new Axis (chart); axis._date_format = this._date_format; @@ -86,11 +129,6 @@ namespace CairoChart { return axis; } - public Axis (Chart chart) { - this.chart = chart; - title = new Text (chart, ""); - } - public int nrecords = 128; public virtual void format_date_time (Float128 x, out string date, out string time) { @@ -133,8 +171,8 @@ namespace CairoChart { } } - public virtual void unzoom () { - range.unzoom(); + public virtual void zoom_out () { + range.zoom_out(); } } } diff --git a/src/Chart.vala b/src/Chart.vala index e52a57d..ad31db2 100644 --- a/src/Chart.vala +++ b/src/Chart.vala @@ -253,7 +253,7 @@ namespace CairoChart { * Zooms out the ``Chart``. */ public virtual void zoom_out () { - foreach (var s in series) s.unzoom(); + foreach (var s in series) s.zoom_out(); zoom = new Area.with_abs (0, 0, 1, 1); zoom_1st_idx = 0; } diff --git a/src/Place.vala b/src/Place.vala index d3f3bcb..1f10a35 100644 --- a/src/Place.vala +++ b/src/Place.vala @@ -210,7 +210,7 @@ namespace CairoChart { /** * Unzooms ``Place``. */ - public virtual void unzoom () { + public virtual void zoom_out () { zx0 = x0; zy0 = y0; zx1 = x1; diff --git a/src/Range.vala b/src/Range.vala index a54fbee..0527055 100644 --- a/src/Range.vala +++ b/src/Range.vala @@ -105,7 +105,7 @@ namespace CairoChart { /** * Unzooms ``Range``. */ - public virtual void unzoom () { + public virtual void zoom_out () { zmin = min; zmax = max; } diff --git a/src/Series.vala b/src/Series.vala index 1e73fd4..e860f96 100644 --- a/src/Series.vala +++ b/src/Series.vala @@ -544,11 +544,11 @@ namespace CairoChart { return Point128 (get_real_x(p.x), get_real_y(p.y)); } - public virtual void unzoom () { + public virtual void zoom_out () { zoom_show = true; - axis_x.unzoom(); - axis_y.unzoom(); - place.unzoom(); + axis_x.zoom_out(); + axis_y.zoom_out(); + place.zoom_out(); } } }