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
import java.awt.geom.AffineTransform;
import java.awt.geom.PathIterator;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.BufferedImageOp;
import java.awt.image.ImageObserver;
import java.awt.image.RenderedImage;
import java.awt.image.renderable.RenderableImage;
import java.text.AttributedCharacterIterator;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Stack;
import org.eclipse.birt.chart.device.svg.i18n.Messages;
import org.eclipse.birt.chart.log.ILogger;
import org.eclipse.birt.chart.log.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
 * This class provides the graphic context to draw primitive svg drawing
 * elements such as lines, rectangles, polygons, etc.
 */
public class SVGGraphics2D extends Graphics2D
{
	protected Document dom;
	protected Paint paint;
	protected Color color;
	protected Font font;
	protected Shape clip;
	protected Stroke stroke;