OK In progress...

This commit is contained in:
Kolan Sh 2018-01-23 18:42:28 +03:00
parent 803a7c3cb6
commit 85eedafd2a
1 changed files with 17 additions and 15 deletions

View File

@ -518,9 +518,9 @@ 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)
switch (position) { switch (position) {
case Axis.Position.LOW: case Axis.Position.LOW:
if (is_x) {
chart.ctx.move_to (compact_rec_pos (v, text_t), ey1); text_t.show(); chart.ctx.move_to (compact_rec_pos (v, text_t), 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(); }
@ -528,28 +528,30 @@ namespace CairoChart {
double y = ey1 - max_rec_size; chart.ctx.move_to (scr_v, y); double y = ey1 - max_rec_size; chart.ctx.move_to (scr_v, y);
if (chart.joint_x) chart.ctx.line_to (scr_v, py0); if (chart.joint_x) chart.ctx.line_to (scr_v, py0);
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)));
} else {
chart.ctx.move_to (ex0 - text_t.width, compact_rec_pos (v, text_t));
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);
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:
if (is_x) {
chart.ctx.move_to (compact_rec_pos (v, text_t), ey0); text_t.show(); chart.ctx.move_to (compact_rec_pos (v, text_t), 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);
if (chart.joint_x) chart.ctx.line_to (scr_v, chart.plarea.y1); if (chart.joint_x) chart.ctx.line_to (scr_v, chart.plarea.y1);
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)));
} else { break;
}
else
switch (position) {
case Axis.Position.LOW:
chart.ctx.move_to (ex0 - text_t.width, compact_rec_pos (v, text_t));
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);
else chart.ctx.line_to (double.max (ex0, px0 + pw * ser.axis_x.place.zmax), scr_v);
break;
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, compact_rec_pos (v, text_t));
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);
else chart.ctx.line_to (double.min (x, px0 + pw * ser.axis_x.place.zmin), scr_v); else chart.ctx.line_to (double.min (x, px0 + pw * ser.axis_x.place.zmin), scr_v);
}
break; break;
} }
} }