/**
 * 
 */
package org.racgupta.EasyCharts;

/**
 * @author racgupta
 *
 */
public class Chart extends Region {

	private String title = "Line Chart";
	
	private String titleCode;
	
	private Styles titleStyle;
	
	public String getTitleCode()
	{
		this.titleCode = "svg.append(\"text\").attr(\"x\","+getTotalWidth()/2+").attr(\"y\","+(0-getTopMargin()/2)+")"+       
        ".attr(\"text-anchor\", \"middle\")"+titleStyle.getStyles()+  
        ".text(\""+title+"\");\n";
		return this.titleCode;
	}
	
	
	public Chart() {
		super();
		titleStyle = new Styles();
		titleStyle.setFontSize("12");
		titleStyle.setFontFamily("sans-serif");
		titleStyle.setTextDecoration("underline");
		// TODO Auto-generated constructor stub
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	
}

@@ -583,17 +583,17 @@
 tSize(%221
-2
+4
 %22);%0A%09%09ti
@@ -828,18 +828,103 @@
 = title;%0A%09%7D%0A
+%0A%0A%09public void setTitleStyle(Styles titleStyle) %7B%0A%09%09this.titleStyle = titleStyle;%0A%09%7D%0A
 %09%0A%09%0A%7D%0A

update styling of the chart title