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:
parent
8e666d3dec
commit
737eac7066
|
@ -380,13 +380,6 @@ namespace CairoChart {
|
||||||
|
|
||||||
protected virtual void eval_plarea () {
|
protected virtual void eval_plarea () {
|
||||||
plarea = evarea.copy();
|
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
|
// Check for joint axes
|
||||||
joint_x = joint_y = true;
|
joint_x = joint_y = true;
|
||||||
|
|
|
@ -261,10 +261,10 @@ namespace CairoChart {
|
||||||
case ProcessType.CALC:
|
case ProcessType.CALC:
|
||||||
height = leg_height_sum;
|
height = leg_height_sum;
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case Position.TOP: chart.evarea.y0 += height; break;
|
case Position.TOP: chart.evarea.y0 += height + spacing; break;
|
||||||
case Position.BOTTOM: chart.evarea.y1 -= height; break;
|
case Position.BOTTOM: chart.evarea.y1 -= height + spacing; break;
|
||||||
case Position.LEFT: chart.evarea.x0 += width; break;
|
case Position.LEFT: chart.evarea.x0 += width + spacing; break;
|
||||||
case Position.RIGHT: chart.evarea.x1 -= width; break;
|
case Position.RIGHT: chart.evarea.x1 -= width + spacing; break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue