In progress...

This commit is contained in:
Kolan Sh 2018-01-18 16:57:39 +03:00
parent e0bf3884c4
commit b4bc90c45d
4 changed files with 12 additions and 12 deletions

View File

@ -17,13 +17,13 @@ namespace CairoChart {
{ x = 0, y = 0, width = 1, height = 1 };
/**
* Zoom Limits (relative coordinates: 0.0-1.0).
* Zoom area limits (relative coordinates: 0.0-1.0).
*/
public Cairo.Rectangle zoom = Cairo.Rectangle()
{ x = 0, y = 0, width = 1, height = 1 };
/**
* Plot Area Bounds.
* Plot area bounds.
*/
public Cairo.Rectangle plarea = Cairo.Rectangle()
{ x = 0, y = 0, width = 1, height = 1 };
@ -76,7 +76,7 @@ namespace CairoChart {
/**
* Joint/common axis color.
*/
public Color joint_axis_color = Color (0, 0, 0, 1);
public Color joint_color = Color (0, 0, 0, 1);
/**
* Selection line style.

View File

@ -386,7 +386,7 @@ namespace CairoChart {
chart.color = s.axis_x.color;
var text_t = new Text(s.axis_x.format.printf((LongDouble)point.x), s.axis_x.font_style);
chart.ctx.move_to (svp.x - size.x / 2, svp.y + text_t.get_height(chart.ctx) / 2);
if (chart.joint_x) chart.color = chart.joint_axis_color;
if (chart.joint_x) chart.color = chart.joint_color;
text_t.show(chart.ctx);
}
@ -399,7 +399,7 @@ namespace CairoChart {
var y = svp.y + sz.height / 2;
if (show_date) y -= sz.height / 2 + s.axis_x.font_indent / 2;
chart.ctx.move_to (svp.x - size.x / 2, y);
if (chart.joint_x) chart.color = chart.joint_axis_color;
if (chart.joint_x) chart.color = chart.joint_color;
text_t.show(chart.ctx);
}
@ -412,7 +412,7 @@ namespace CairoChart {
var y = svp.y + sz.height / 2;
if (show_time) y += sz.height / 2 + s.axis_x.font_indent / 2;
chart.ctx.move_to (svp.x - size.x / 2, y);
if (chart.joint_x) chart.color = chart.joint_axis_color;
if (chart.joint_x) chart.color = chart.joint_color;
text_t.show(chart.ctx);
}
@ -421,7 +421,7 @@ namespace CairoChart {
var text_t = new Text(s.axis_y.format.printf((LongDouble)point.y), s.axis_y.font_style);
var sz = text_t.get_size(chart.ctx);
chart.ctx.move_to (svp.x + size.x / 2 - sz.width, svp.y + sz.height / 2);
if (chart.joint_y) chart.color = chart.joint_axis_color;
if (chart.joint_y) chart.color = chart.joint_color;
text_t.show(chart.ctx);
}
}

View File

@ -253,7 +253,7 @@ namespace CairoChart {
var joint_x = chart.joint_x;
for (Float128 x = x_min, x_max = axis_x.zoom_max; chart.math.point_belong (x, x_min, x_max); x += step) {
if (joint_x) chart.color = chart.joint_axis_color;
if (joint_x) chart.color = chart.joint_color;
else chart.color = axis_x.color;
string text = "", time_text = "";
switch (axis_x.type) {
@ -377,7 +377,7 @@ namespace CairoChart {
}
chart.ctx.move_to(scr_x - sz.width / 2.0, scr_y);
chart.color = s.axis_x.color;
if (chart.joint_x) chart.color = chart.joint_axis_color;
if (chart.joint_x) chart.color = chart.joint_color;
s.axis_x.title.show(chart.ctx);
}
@ -408,7 +408,7 @@ namespace CairoChart {
var joint_y = chart.joint_y;
for (Float128 y = y_min, y_max = axis_y.zoom_max; chart.math.point_belong (y, y_min, y_max); y += step) {
if (joint_y) chart.color = chart.joint_axis_color;
if (joint_y) chart.color = chart.joint_color;
else chart.color = axis_y.color;
var text = axis_y.format.printf((LongDouble)y);
var scr_y = get_scr_y (y);
@ -505,7 +505,7 @@ namespace CairoChart {
break;
}
chart.color = s.axis_y.color;
if (chart.joint_y) chart.color = chart.joint_axis_color;
if (chart.joint_y) chart.color = chart.joint_color;
s.axis_y.title.show(chart.ctx);
}

View File

@ -441,7 +441,7 @@ int main (string[] args) {
ctx.rectangle (x0, y0 - h, w, h);
ctx.fill();
ctx.move_to (x0, y0);
chart.color = chart.joint_axis_color;
chart.color = chart.joint_color;
ctx.show_text(text);
}