OK In progress...
This commit is contained in:
parent
2d1f588393
commit
cb90a82119
|
@ -57,9 +57,6 @@ namespace CairoChart {
|
||||||
*/
|
*/
|
||||||
public int zoom_1st_idx { get; protected set; default = 0; }
|
public int zoom_1st_idx { get; protected set; default = 0; }
|
||||||
|
|
||||||
public double title_width { get; protected set; default = 0.0; }
|
|
||||||
public double title_height { get; protected set; default = 0.0; }
|
|
||||||
|
|
||||||
public double title_indent = 4;
|
public double title_indent = 4;
|
||||||
|
|
||||||
public Line.Style selection_style = Line.Style ();
|
public Line.Style selection_style = Line.Style ();
|
||||||
|
@ -102,9 +99,7 @@ namespace CairoChart {
|
||||||
chart.selection_style = this.selection_style;
|
chart.selection_style = this.selection_style;
|
||||||
chart.series = this.series;
|
chart.series = this.series;
|
||||||
chart.title = this.title.copy();
|
chart.title = this.title.copy();
|
||||||
chart.title_height = this.title_height;
|
|
||||||
chart.title_indent = this.title_indent;
|
chart.title_indent = this.title_indent;
|
||||||
chart.title_width = this.title_width;
|
|
||||||
chart.pos = this.pos;
|
chart.pos = this.pos;
|
||||||
chart.zoom_1st_idx = this.zoom_1st_idx;
|
chart.zoom_1st_idx = this.zoom_1st_idx;
|
||||||
return chart;
|
return chart;
|
||||||
|
@ -164,7 +159,7 @@ namespace CairoChart {
|
||||||
}
|
}
|
||||||
protected virtual void draw_chart_title () {
|
protected virtual void draw_chart_title () {
|
||||||
var sz = title.get_size(ctx);
|
var sz = title.get_size(ctx);
|
||||||
title_height = sz.height + (legend.position == Legend.Position.TOP ? title_indent * 2 : title_indent);
|
var title_height = sz.height + (legend.position == Legend.Position.TOP ? title_indent * 2 : title_indent);
|
||||||
calc_pos.y += title_height;
|
calc_pos.y += title_height;
|
||||||
calc_pos.height -= title_height;
|
calc_pos.height -= title_height;
|
||||||
color = title.color;
|
color = title.color;
|
||||||
|
|
|
@ -304,8 +304,11 @@ namespace CairoChart {
|
||||||
case Axis.Position.LOW: print_y = chart.pos.y + chart.pos.height - s.axis_x.font_indent
|
case Axis.Position.LOW: print_y = chart.pos.y + chart.pos.height - s.axis_x.font_indent
|
||||||
- (chart.legend.position == Legend.Position.BOTTOM ? chart.legend.height : 0);
|
- (chart.legend.position == Legend.Position.BOTTOM ? chart.legend.height : 0);
|
||||||
break;
|
break;
|
||||||
case Axis.Position.HIGH: print_y = chart.pos.y + chart.title_height + s.axis_x.font_indent
|
case Axis.Position.HIGH:
|
||||||
+ (chart.legend.position == Legend.Position.TOP ? chart.legend.height : 0);
|
var title_height = chart.title.get_height(chart.ctx) + (chart.legend.position == Legend.Position.TOP ?
|
||||||
|
chart.title_indent * 2 : chart.title_indent);
|
||||||
|
print_y = chart.pos.y + title_height + s.axis_x.font_indent
|
||||||
|
+ (chart.legend.position == Legend.Position.TOP ? chart.legend.height : 0);
|
||||||
switch (s.axis_x.type) {
|
switch (s.axis_x.type) {
|
||||||
case Axis.Type.NUMBERS:
|
case Axis.Type.NUMBERS:
|
||||||
print_y += sz.height;
|
print_y += sz.height;
|
||||||
|
|
|
@ -52,7 +52,9 @@ namespace CairoChart {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case Position.TOP:
|
case Position.TOP:
|
||||||
x0 = (chart.pos.width - width) / 2;
|
x0 = (chart.pos.width - width) / 2;
|
||||||
y0 = chart.title_height;
|
var title_height = chart.title.get_height(chart.ctx) + (chart.legend.position == Legend.Position.TOP ?
|
||||||
|
chart.title_indent * 2 : chart.title_indent);
|
||||||
|
y0 = title_height;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Position.BOTTOM:
|
case Position.BOTTOM:
|
||||||
|
|
Loading…
Reference in New Issue