From 491c303d4f5c0db1df1582d1b439c34c91a7edcd Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 22 Jan 2018 16:49:28 +0300 Subject: [PATCH] OK In progress... --- src/Chart.vala | 17 +++++++++-------- src/Legend.vala | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Chart.vala b/src/Chart.vala index 2b4b25b..42cfee9 100644 --- a/src/Chart.vala +++ b/src/Chart.vala @@ -308,14 +308,15 @@ namespace CairoChart { } protected virtual void eval_plarea () { - plarea.x0 = evarea.x0 + legend.spacing; - plarea.width = evarea.width - 2 * legend.spacing; - plarea.y0 = evarea.y0 + legend.spacing; - plarea.height = evarea.height - 2 * legend.spacing; - /*plarea.x0 = evarea.x0 + (legend.show ? legend.spacing : 0); - plarea.width = evarea.width - 2 * (legend.show ? legend.spacing : 0); - plarea.y0 = evarea.y0 + (legend.show ? legend.spacing : 0); - plarea.height = evarea.height - 2 * (legend.show ? legend.spacing : 0);*/ + plarea = evarea.copy(); + legend.show = false; + if (legend.show) + switch(legend.position) { + case Legend.Position.TOP: plarea.y0 += legend.spacing; break; + case Legend.Position.BOTTOM: plarea.y1 -= legend.spacing; break; + case Legend.Position.LEFT: plarea.x0 += legend.spacing; break; + case Legend.Position.RIGHT: plarea.x1 -= legend.spacing; break; + } // Check for joint axes joint_x = joint_y = true; diff --git a/src/Legend.vala b/src/Legend.vala index a0e0542..9bfc614 100644 --- a/src/Legend.vala +++ b/src/Legend.vala @@ -45,7 +45,7 @@ namespace CairoChart { */ public LineStyle border_style = LineStyle (); - public double spacing = 5; + public double spacing = 50; public double width = 0; public double height = 0; public double line_length = 30.0;