Fixes #159: Inconstant space between axis values and plot area (depending on legend position)...

Fixes #158: legend.spacing=50: not only plarea.x0-y1 should be changed but axis positions too.
This commit is contained in:
Kolan Sh 2018-01-24 14:19:32 +03:00
parent 8e666d3dec
commit 737eac7066
2 changed files with 4 additions and 11 deletions

View File

@ -380,13 +380,6 @@ namespace CairoChart {
protected virtual void eval_plarea () {
plarea = evarea.copy();
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;

View File

@ -261,10 +261,10 @@ namespace CairoChart {
case ProcessType.CALC:
height = leg_height_sum;
switch (position) {
case Position.TOP: chart.evarea.y0 += height; break;
case Position.BOTTOM: chart.evarea.y1 -= height; break;
case Position.LEFT: chart.evarea.x0 += width; break;
case Position.RIGHT: chart.evarea.x1 -= width; break;
case Position.TOP: chart.evarea.y0 += height + spacing; break;
case Position.BOTTOM: chart.evarea.y1 -= height + spacing; break;
case Position.LEFT: chart.evarea.x0 += width + spacing; break;
case Position.RIGHT: chart.evarea.x1 -= width + spacing; break;
}
break;
}