In progress...
This commit is contained in:
parent
328a579ad7
commit
dcfb85126e
|
@ -110,13 +110,13 @@ namespace CairoChart {
|
||||||
time = dt.format(time_format) + dsec_str;
|
time = dt.format(time_format) + dsec_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void calc_rec_sizes (Chart chart, out double max_rec_width, out double max_rec_height, bool is_horizontal = true) {
|
public virtual void calc_rec_sizes (Chart chart, out double max_rec_width, out double max_rec_height, bool horizontal = true) {
|
||||||
max_rec_width = max_rec_height = 0;
|
max_rec_width = max_rec_height = 0;
|
||||||
for (var i = 0; i < nrecords; ++i) {
|
for (var i = 0; i < nrecords; ++i) {
|
||||||
Float128 x = (int64)(zoom_min + (zoom_max - zoom_min) / nrecords * i) + 1.0/3.0;
|
Float128 x = (int64)(zoom_min + (zoom_max - zoom_min) / nrecords * i) + 1.0/3.0;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Axis.Type.NUMBERS:
|
case Axis.Type.NUMBERS:
|
||||||
var text = new Text (format.printf((LongDouble)x) + (is_horizontal ? "_" : ""), font_style);
|
var text = new Text (format.printf((LongDouble)x) + (horizontal ? "_" : ""), font_style);
|
||||||
var sz = text.get_size(chart.context);
|
var sz = text.get_size(chart.context);
|
||||||
max_rec_width = double.max (max_rec_width, sz.width);
|
max_rec_width = double.max (max_rec_width, sz.width);
|
||||||
max_rec_height = double.max (max_rec_height, sz.height);
|
max_rec_height = double.max (max_rec_height, sz.height);
|
||||||
|
@ -127,13 +127,13 @@ namespace CairoChart {
|
||||||
|
|
||||||
var h = 0.0;
|
var h = 0.0;
|
||||||
if (date_format != "") {
|
if (date_format != "") {
|
||||||
var text = new Text (date + (is_horizontal ? "_" : ""), font_style);
|
var text = new Text (date + (horizontal ? "_" : ""), font_style);
|
||||||
var sz = text.get_size(chart.context);
|
var sz = text.get_size(chart.context);
|
||||||
max_rec_width = double.max (max_rec_width, sz.width);
|
max_rec_width = double.max (max_rec_width, sz.width);
|
||||||
h = sz.height;
|
h = sz.height;
|
||||||
}
|
}
|
||||||
if (time_format != "") {
|
if (time_format != "") {
|
||||||
var text = new Text (time + (is_horizontal ? "_" : ""), font_style);
|
var text = new Text (time + (horizontal ? "_" : ""), font_style);
|
||||||
var sz = text.get_size(chart.context);
|
var sz = text.get_size(chart.context);
|
||||||
max_rec_width = double.max (max_rec_width, sz.width);
|
max_rec_width = double.max (max_rec_width, sz.width);
|
||||||
h += sz.height;
|
h += sz.height;
|
||||||
|
|
|
@ -251,7 +251,7 @@ namespace CairoChart {
|
||||||
if (nzoom_series_show == 1) joint_x = joint_y = false;
|
if (nzoom_series_show == 1) joint_x = joint_y = false;
|
||||||
|
|
||||||
// Join and calc X-axes
|
// Join and calc X-axes
|
||||||
for (var si = series.length - 1, nskip = 0; si >=0; --si) {
|
for (var si = series.length - 1, nskip = 0; si >= 0; --si) {
|
||||||
var s = series[si];
|
var s = series[si];
|
||||||
if (!s.zoom_show) continue;
|
if (!s.zoom_show) continue;
|
||||||
if (nskip != 0) {--nskip; continue;}
|
if (nskip != 0) {--nskip; continue;}
|
||||||
|
@ -278,7 +278,7 @@ namespace CairoChart {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Join and calc Y-axes
|
// Join and calc Y-axes
|
||||||
for (var si = series.length - 1, nskip = 0; si >=0; --si) {
|
for (var si = series.length - 1, nskip = 0; si >= 0; --si) {
|
||||||
var s = series[si];
|
var s = series[si];
|
||||||
if (!s.zoom_show) continue;
|
if (!s.zoom_show) continue;
|
||||||
if (nskip != 0) {--nskip; continue;}
|
if (nskip != 0) {--nskip; continue;}
|
||||||
|
|
Loading…
Reference in New Issue