OK In progress...

This commit is contained in:
Kolan Sh 2018-01-23 18:49:24 +03:00
parent 85eedafd2a
commit 2a0870a482
1 changed files with 11 additions and 7 deletions

View File

@ -518,10 +518,11 @@ namespace CairoChart {
var py0 = chart.plarea.y0, ey0 = chart.evarea.y0 + max_rec_size + tthv, ey1 = chart.evarea.y1 - tthv; var py0 = chart.plarea.y0, ey0 = chart.evarea.y0 + max_rec_size + tthv, ey1 = chart.evarea.y1 - tthv;
var px0 = chart.plarea.x0, ex0 = chart.evarea.x0 + max_rec_size + ttwh, ex1 = chart.evarea.x1 - ttwh; var px0 = chart.plarea.x0, ex0 = chart.evarea.x0 + max_rec_size + ttwh, ex1 = chart.evarea.x1 - ttwh;
var ph = chart.plarea.height, pw = chart.plarea.width; var ph = chart.plarea.height, pw = chart.plarea.width;
if (is_x) if (is_x) {
var crp = compact_rec_pos (v, text_t);
switch (position) { switch (position) {
case Axis.Position.LOW: case Axis.Position.LOW:
chart.ctx.move_to (compact_rec_pos (v, text_t), ey1); text_t.show(); chart.ctx.move_to (crp, ey1); text_t.show();
if (dtype == Axis.DType.DATE_TIME) if (dtype == Axis.DType.DATE_TIME)
{ chart.ctx.move_to (crpt, ey1 - dtf); time_text_t.show(); } { chart.ctx.move_to (crpt, ey1 - dtf); time_text_t.show(); }
ser.grid.style.apply(chart); ser.grid.style.apply(chart);
@ -530,7 +531,7 @@ namespace CairoChart {
else chart.ctx.line_to (scr_v, double.min (y, py0 + ph * (1 - ser.axis_y.place.zmax))); else chart.ctx.line_to (scr_v, double.min (y, py0 + ph * (1 - ser.axis_y.place.zmax)));
break; break;
case Axis.Position.HIGH: case Axis.Position.HIGH:
chart.ctx.move_to (compact_rec_pos (v, text_t), ey0); text_t.show(); chart.ctx.move_to (crp, ey0); text_t.show();
if (dtype == Axis.DType.DATE_TIME) if (dtype == Axis.DType.DATE_TIME)
{ chart.ctx.move_to (crpt, ey0 - dtf); time_text_t.show(); } { chart.ctx.move_to (crpt, ey0 - dtf); time_text_t.show(); }
ser.grid.style.apply(chart); chart.ctx.move_to (scr_v, ey0); ser.grid.style.apply(chart); chart.ctx.move_to (scr_v, ey0);
@ -538,16 +539,18 @@ namespace CairoChart {
else chart.ctx.line_to (scr_v, double.max (ey0, py0 + ph * (1 - ser.axis_y.place.zmin))); else chart.ctx.line_to (scr_v, double.max (ey0, py0 + ph * (1 - ser.axis_y.place.zmin)));
break; break;
} }
else } else {
var crp = compact_rec_pos (v, text_t);
switch (position) { switch (position) {
case Axis.Position.LOW: case Axis.Position.LOW:
chart.ctx.move_to (ex0 - text_t.width, compact_rec_pos (v, text_t)); chart.ctx.move_to (ex0 - text_t.width, crp);
text_t.show(); ser.grid.style.apply(chart); chart.ctx.move_to (ex0, scr_v); text_t.show(); ser.grid.style.apply(chart);
chart.ctx.move_to (ex0, scr_v);
if (chart.joint_y) chart.ctx.line_to (chart.plarea.x1, scr_v); if (chart.joint_y) chart.ctx.line_to (chart.plarea.x1, scr_v);
else chart.ctx.line_to (double.max (ex0, px0 + pw * ser.axis_x.place.zmax), scr_v); else chart.ctx.line_to (double.max (ex0, px0 + pw * ser.axis_x.place.zmax), scr_v);
break; break;
case Axis.Position.HIGH: case Axis.Position.HIGH:
chart.ctx.move_to (ex1 - text_t.width, compact_rec_pos (v, text_t)); chart.ctx.move_to (ex1 - text_t.width, crp);
text_t.show(); ser.grid.style.apply(chart); text_t.show(); ser.grid.style.apply(chart);
double x = ex1 - max_rec_size; chart.ctx.move_to (x, scr_v); double x = ex1 - max_rec_size; chart.ctx.move_to (x, scr_v);
if (chart.joint_y) chart.ctx.line_to (px0, scr_v); if (chart.joint_y) chart.ctx.line_to (px0, scr_v);
@ -557,4 +560,5 @@ namespace CairoChart {
} }
} }
} }
}
} }