OK In progress...
This commit is contained in:
parent
820e5d4526
commit
1eee87fb1a
|
@ -67,16 +67,6 @@ namespace CairoChart {
|
||||||
*/
|
*/
|
||||||
public double line_length = 30.0;
|
public double line_length = 30.0;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public double text_hspace = 10.0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public double text_vspace = 2.0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show legend?
|
* Show legend?
|
||||||
*/
|
*/
|
||||||
|
@ -101,8 +91,6 @@ namespace CairoChart {
|
||||||
legend.spacing = this.spacing;
|
legend.spacing = this.spacing;
|
||||||
legend.height = this.height;
|
legend.height = this.height;
|
||||||
legend.line_length = this.line_length;
|
legend.line_length = this.line_length;
|
||||||
legend.text_hspace = this.text_hspace;
|
|
||||||
legend.text_vspace = this.text_vspace;
|
|
||||||
legend.width = this.width;
|
legend.width = this.width;
|
||||||
legend.show = this.show;
|
legend.show = this.show;
|
||||||
legend.max_font_heights = this.max_font_heights;
|
legend.max_font_heights = this.max_font_heights;
|
||||||
|
@ -192,7 +180,7 @@ namespace CairoChart {
|
||||||
case Position.TOP:
|
case Position.TOP:
|
||||||
case Position.BOTTOM:
|
case Position.BOTTOM:
|
||||||
var ser_title_width = s.title.width + line_length;
|
var ser_title_width = s.title.width + line_length;
|
||||||
if (leg_width_sum + (leg_width_sum == 0 ? 0 : text_hspace) + ser_title_width > chart.area.width) { // carry
|
if (leg_width_sum + (leg_width_sum == 0 ? 0 : s.title.font.hspacing) + ser_title_width > chart.area.width) { // carry
|
||||||
leg_height_sum += max_font_h;
|
leg_height_sum += max_font_h;
|
||||||
switch (process_type) {
|
switch (process_type) {
|
||||||
case ProcessType.CALC:
|
case ProcessType.CALC:
|
||||||
|
@ -211,8 +199,8 @@ namespace CairoChart {
|
||||||
|
|
||||||
switch (process_type) {
|
switch (process_type) {
|
||||||
case ProcessType.DRAW:
|
case ProcessType.DRAW:
|
||||||
var x = legend_x0 + leg_width_sum + (leg_width_sum == 0.0 ? 0.0 : text_hspace);
|
var x = legend_x0 + leg_width_sum + (leg_width_sum == 0 ? 0 : s.title.font.hspacing);
|
||||||
var y = legend_y0 + leg_height_sum + max_font_heights[heights_idx] / 2.0 + s.title.height / 2.0;
|
var y = legend_y0 + leg_height_sum + max_font_heights[heights_idx] / 2 + s.title.height / 2;
|
||||||
|
|
||||||
// series title
|
// series title
|
||||||
chart.ctx.move_to (x + line_length, y);
|
chart.ctx.move_to (x + line_length, y);
|
||||||
|
@ -232,22 +220,22 @@ namespace CairoChart {
|
||||||
case Position.TOP:
|
case Position.TOP:
|
||||||
case Position.BOTTOM:
|
case Position.BOTTOM:
|
||||||
var ser_title_width = s.title.width + line_length;
|
var ser_title_width = s.title.width + line_length;
|
||||||
leg_width_sum += (leg_width_sum == 0 ? 0 : text_hspace) + ser_title_width;
|
leg_width_sum += (leg_width_sum == 0 ? 0 : s.title.font.hspacing) + ser_title_width;
|
||||||
max_font_h = double.max (max_font_h, s.title.height) + (leg_height_sum != 0 ? text_vspace : 0);
|
max_font_h = double.max (max_font_h, s.title.height) + (leg_height_sum != 0 ? s.title.font.vspacing : 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Position.LEFT:
|
case Position.LEFT:
|
||||||
case Position.RIGHT:
|
case Position.RIGHT:
|
||||||
switch (process_type) {
|
switch (process_type) {
|
||||||
case ProcessType.CALC:
|
case ProcessType.CALC:
|
||||||
max_font_heights += s.title.height + (leg_height_sum != 0 ? text_vspace : 0);
|
max_font_heights += s.title.height + (leg_height_sum != 0 ? s.title.font.vspacing : 0);
|
||||||
width = double.max (width, s.title.width + line_length);
|
width = double.max (width, s.title.width + line_length);
|
||||||
break;
|
break;
|
||||||
case ProcessType.DRAW:
|
case ProcessType.DRAW:
|
||||||
heights_idx++;
|
heights_idx++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
leg_height_sum += s.title.height + (leg_height_sum != 0 ? text_vspace : 0);
|
leg_height_sum += s.title.height + (leg_height_sum != 0 ? s.title.font.vspacing : 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue