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
elem.setAttribute( "font-family", getFont().getFamily()); 
		elem.setAttribute( "font-size", Integer.toString(getFont().getSize())); 
		String style = getRenderingStyle(RenderingHints.KEY_TEXT_ANTIALIASING);
		if ( color != null ){
			String alpha = alphaToString( color );
			if ( alpha != null )
				style += "fill-opacity:" + alpha + ";"; 
			style += "fill:" + serializeToString( color ) + ";"; 
		}
		elem.setAttribute("style", style);
		if ( transforms.getType( ) != AffineTransform.TYPE_IDENTITY )
		{
			double[] matrix = new double[6];
			transforms.getMatrix( matrix );
			elem.setAttribute( "transform", "matrix(" + matrix[0] + "," + matrix[1] + "," + matrix[2] + "," + matrix[3] + "," + matrix[4] + "," + matrix[5] + ")" ); 
		}
		
		return elem;
	}
	
	protected String getRenderingStyle(Object key){
		Object value = renderingHints.get(key);
		if (key.equals(RenderingHints.KEY_TEXT_ANTIALIASING)){
			if (value.equals(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF))
				return "text-rendering:optimizeSpeed;"; 
			else
				
				return "";   
		}
		return "";