Axis spacings fxd.
This commit is contained in:
parent
075db46b66
commit
ef1c12b2d1
|
@ -445,8 +445,8 @@ namespace CairoChart {
|
||||||
switch (axis.dtype) {
|
switch (axis.dtype) {
|
||||||
case DType.NUMBERS:
|
case DType.NUMBERS:
|
||||||
var text = new Text (chart, axis.format.printf((LongDouble)x) + (horizontal ? "_" : ""), axis.font);
|
var text = new Text (chart, axis.format.printf((LongDouble)x) + (horizontal ? "_" : ""), axis.font);
|
||||||
max_rec_width = double.max (max_rec_width, text.width + (horizontal ? text.font.hspacing : 0));
|
max_rec_width = double.max (max_rec_width, text.width + 2 * text.font.hspacing);
|
||||||
max_rec_height = double.max (max_rec_height, text.height + (horizontal ? 0 : text.font.vspacing));
|
max_rec_height = double.max (max_rec_height, text.height + 2 * text.font.vspacing);
|
||||||
break;
|
break;
|
||||||
case DType.DATE_TIME:
|
case DType.DATE_TIME:
|
||||||
string date, time;
|
string date, time;
|
||||||
|
@ -455,12 +455,12 @@ namespace CairoChart {
|
||||||
var h = 0.0;
|
var h = 0.0;
|
||||||
if (axis.date_format != "") {
|
if (axis.date_format != "") {
|
||||||
var text = new Text (chart, date + (horizontal ? "_" : ""), axis.font);
|
var text = new Text (chart, date + (horizontal ? "_" : ""), axis.font);
|
||||||
max_rec_width = double.max (max_rec_width, text.width + text.font.hspacing);
|
max_rec_width = double.max (max_rec_width, text.width + 2 * text.font.hspacing);
|
||||||
h = text.height;
|
h = text.height;
|
||||||
}
|
}
|
||||||
if (axis.time_format != "") {
|
if (axis.time_format != "") {
|
||||||
var text = new Text (chart, time + (horizontal ? "_" : ""), axis.font);
|
var text = new Text (chart, time + (horizontal ? "_" : ""), axis.font);
|
||||||
max_rec_width = double.max (max_rec_width, text.width + text.font.hspacing);
|
max_rec_width = double.max (max_rec_width, text.width + 2 * text.font.hspacing);
|
||||||
h += text.height;
|
h += text.height;
|
||||||
}
|
}
|
||||||
max_rec_height = double.max (max_rec_height, h);
|
max_rec_height = double.max (max_rec_height, h);
|
||||||
|
|
Loading…
Reference in New Issue