From 42feb73732e3efae1eed4cf8474273333f5f1538 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 15 Jan 2018 18:11:38 +0300 Subject: [PATCH] In progress... --- src/Chart.vala | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Chart.vala b/src/Chart.vala index 7c6d9b0..b377e90 100644 --- a/src/Chart.vala +++ b/src/Chart.vala @@ -57,10 +57,10 @@ namespace CairoChart { calc_plot_area (); - draw_horizontal_axis (); + draw_horizontal_axes (); check_cur_values (); - draw_vertical_axis (); + draw_vertical_axes (); check_cur_values (); draw_plot_area_border (); @@ -318,11 +318,10 @@ namespace CairoChart { public CairoChart.Math math = new Math(); - protected virtual void draw_horizontal_axis () { - for (var si = series.length - 1, nskip = 0; si >=0; --si) { + protected virtual void draw_horizontal_axis (int si, ref int nskip) { var s = series[si]; - if (!s.zoom_show) continue; - if (joint_x && si != zoom_first_show) continue; + if (!s.zoom_show) return; + if (joint_x && si != zoom_first_show) return; // 1. Detect max record width/height by axis.nrecords equally selected points using format. double max_rec_width, max_rec_height; @@ -450,7 +449,7 @@ namespace CairoChart { double tmp1 = 0, tmp2 = 0, tmp3 = 0, tmp4 = 0; s.join_relative_x_axes (this, si, false, ref tmp1, ref tmp2, ref tmp3, ref tmp4, ref nskip); - if (nskip != 0) {--nskip; continue;} + if (nskip != 0) {--nskip; return;} switch (s.axis_x.position) { case Axis.Position.LOW: @@ -462,10 +461,16 @@ namespace CairoChart { + (s.axis_x.title.text == "" ? 0 : sz.height + s.axis_x.font_indent); break; } + + } + + protected virtual void draw_horizontal_axes () { + for (var si = series.length - 1, nskip = 0; si >=0; --si) { + draw_horizontal_axis (si, ref nskip); } } - protected virtual void draw_vertical_axis () { + protected virtual void draw_vertical_axes () { for (var si = series.length - 1, nskip = 0; si >=0; --si) { var s = series[si]; if (!s.zoom_show) continue;