Bug 141248 Script: Set axis title background color, axis title can be covered.
Script: Set axis title background color, axis title can be covered. Steps: 1.Create a bar chart 2.Script:function beforeDrawAxisTitle(axis, title, scriptContext) { importPackage(Packages.org.eclipse.birt.chart.model.attribute); importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl); { if (axis.getType() == AxisType.LINEAR_LITERAL) title.setVisible(false);} title.getCaption().getColor( ).set( 208, 32, 0); title.getCaption().getFont().setItalic(true); title.getCaption().getFont().setRotation(30); title.getCaption().getFont().setStrikethrough(true); title.getCaption().getFont().setSize(14); title.getCaption().getFont().setName("Arial"); title.getOutline().setVisible(true); title.getOutline().setThickness(3); title.setBackground(ColorDefinitionImpl.ORANGE()); } 3.Preview Actual Results: 1.Axis title can be covered Expected Results: 1.Axis title is visible.
chart/org.eclipse.birt.chart.device.svg/src/org/eclipse/birt/chart/device/svg/SVGGraphics2D.java
* 
	 * @param script the code that will be inlined in the generated svg output
	 */
	public void addScript(String script){
		scriptBuffer.append(script);	
	}
	
	/**
	 * Adds a script reference in the generated svg output.
	 * 
	 * @param ref the script reference that will be added to the generated svg output.
	 */
	public void addScriptRef(String ref){
		Element rootElem = dom.getDocumentElement( );
		Element scriptElem = dom.createElement( "script" ); 
		rootElem.appendChild( scriptElem );
		scriptElem.setAttribute( "language", "JavaScript" ); 
		scriptElem.setAttribute( "xlink:href", ref ); 		
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	/**
	 * Defer setting the stroke and color on an SVG element.
	 * 
	 * @return the state of the flag that ignores setting the stroke style and color on a svg element.
	 */