OK In progress...

This commit is contained in:
Kolan Sh 2018-01-22 14:44:31 +03:00
parent bcb847c65e
commit 47bc860e3d
5 changed files with 59 additions and 21 deletions

View File

@ -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();
}
}
}

View File

@ -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;
}

View File

@ -210,7 +210,7 @@ namespace CairoChart {
/**
* Unzooms ``Place``.
*/
public virtual void unzoom () {
public virtual void zoom_out () {
zx0 = x0;
zy0 = y0;
zx1 = x1;

View File

@ -105,7 +105,7 @@ namespace CairoChart {
/**
* Unzooms ``Range``.
*/
public virtual void unzoom () {
public virtual void zoom_out () {
zmin = min;
zmax = max;
}

View File

@ -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();
}
}
}