| java.lang.Object org.pentaho.plugin.jfreechart.JFreeChartEngine
JFreeChartEngine | public class JFreeChartEngine (Code) | | |
Method Summary | |
public static JFreeChart | getChart(Dataset dataset, String title, String units, int width, int height, ILogger logger) Create a chart-object using dataset object. | public static int | getChartType(String typeStr) | public static String | getChartTypeName(int type) | public static Color | getColor(String htmlColor) | public static Font | getFont(Node fontNode) | public static Paint | getGradientPaint(Node gradientNode, int width, int height) | public static Image | getImage(Node chartBackgroundImageNode, IPentahoSession session) | public static Image | getImage(String imageName, IPentahoSession session) | public static Stroke | getLineStyleStroke(String lineStyle, float lineWidth) | public static Paint | getPaint(Node node, int width, int height, IPentahoSession session) | public static Paint | getPaint(Node node) | public static Paint | getPaint(String htmlColor) | public static Paint | getTexturePaint(Node textureNode, int width, int height, IPentahoSession session) | public static Color | getTransparent() | public static boolean | isBarColumn(String[] barColumns, String columnName) | public static boolean | isLineColumn(String[] lineColumns, String columnName) | public static void | saveChart(Dataset dataset, String title, String units, String fileName, int width, int height, int outputType, PrintWriter writer, ILogger logger) Create an image file using dataset object. | public static void | saveChart(Dataset dataset, String title, String units, String fileName, int width, int height, int outputType, PrintWriter writer, ChartRenderingInfo info, ILogger logger) Create an image file using dataset object. |
AREA_CHART_TYPE | final public static int AREA_CHART_TYPE(Code) | | |
BAR_CHART_TYPE | final public static int BAR_CHART_TYPE(Code) | | |
BAR_LINE_CHART_TYPE | final public static int BAR_LINE_CHART_TYPE(Code) | | |
BUBBLE_CHART_TYPE | final public static int BUBBLE_CHART_TYPE(Code) | | |
DIAL_CHART_TYPE | final public static int DIAL_CHART_TYPE(Code) | | |
DIFFERENCE_CHART_TYPE | final public static int DIFFERENCE_CHART_TYPE(Code) | | |
DOT_CHART_TYPE | final public static int DOT_CHART_TYPE(Code) | | |
LINE_CHART_TYPE | final public static int LINE_CHART_TYPE(Code) | | |
OUTPUT_CHART | final public static int OUTPUT_CHART(Code) | | |
OUTPUT_PNG | final public static int OUTPUT_PNG(Code) | | |
OUTPUT_PNG_BYTES | final public static int OUTPUT_PNG_BYTES(Code) | | |
OUTPUT_SVG | final public static int OUTPUT_SVG(Code) | | |
PIE_CHART_TYPE | final public static int PIE_CHART_TYPE(Code) | | |
PIE_GRID_CHART_TYPE | final public static int PIE_GRID_CHART_TYPE(Code) | | |
STEP_AREA_CHART_TYPE | final public static int STEP_AREA_CHART_TYPE(Code) | | |
STEP_CHART_TYPE | final public static int STEP_CHART_TYPE(Code) | | |
THERMOMETER_CHART_TYPE | final public static int THERMOMETER_CHART_TYPE(Code) | | |
UNDEFINED_CHART_TYPE | final public static int UNDEFINED_CHART_TYPE(Code) | | |
getChart | public static JFreeChart getChart(Dataset dataset, String title, String units, int width, int height, ILogger logger)(Code) | | Create a chart-object using dataset object. This method takes a dataset
object, e.g. a DialWidgetDefinition, and creates and returns a JFreeChart
object from it.
Parameters: dataset - The dataset Parameters: title - The title of the chart Parameters: units - The units of the chart value Parameters: width - The width of the image to create Parameters: height - The height of the image to create Parameters: logger - The logger to log any messages to JFreeChart the generated chart object |
getChartType | public static int getChartType(String typeStr)(Code) | | Parameters: typeStr - String name for chart int representing the chart string passed in; -1 if invalid chart name See Also: ChartDefinition See Also: for valid chart name strings and integers |
getChartTypeName | public static String getChartTypeName(int type)(Code) | | Parameters: type - int type for chart String representing the chart See Also: ChartDefinition See Also: for valid chart name strings |
getColor | public static Color getColor(String htmlColor)(Code) | | Creates a java.awt.Color object from an HTML color definition, eg #80dd3f
Parameters: htmlColor - The color string A Color object |
getFont | public static Font getFont(Node fontNode)(Code) | | Creates a java.awt.TexturePaint object from an XML node from the dial
definition document
Parameters: XML - Node from the dial definition Parameters: width - of the chart Parameters: height - of the chart Paint object defined by the node / public static PaintgetTexturePaint( Node node, int width, int height ) {if( node == null ) { return null; } int rectWidth=width; intrectHeight=height; int x=0; int y=0; // Get Image try{ Node imageNode =node.selectSingleNode( "background-image" ); //$NON-NLS-1$ if( imageNode !=null ) { String imageName = imageNode.getText().toString(); StringfileName = PentahoSystem.getApplicationContext().getSolutionPath(imageName ); int offset = fileName.lastIndexOf( "." ); //$NON-NLS-1$String type = offset == -1 ? "jpg" : fileName.substring(offset + 1);//$NON-NLS-1$BufferedImage image = new BufferedImage( width, height,BufferedImage.TYPE_INT_ARGB);ImageIO.write(image, type, new File( fileName ));Node rectangle= node.selectSingleNode("rectangle"); //$NON-NLS-1$ if(rectangle != null ) { Node tmpNode = rectangle.selectSingleNode("width");//$NON-NLS-1$ if( tmpNode != null ) {rectWidth=Integer.parseInt(tmpNode.getText().toString().trim());//$NON-NLS-1$ } tmpNode = rectangle.selectSingleNode("height");//$NON-NLS-1$ if( tmpNode != null ) {rectHeight=Integer.parseInt(tmpNode.getText().toString().trim());//$NON-NLS-1$ } tmpNode = rectangle.selectSingleNode("x"); //$NON-NLS-1$if( tmpNode != null ) {x=Integer.parseInt(tmpNode.getText().toString().trim()); //$NON-NLS-1$ }tmpNode = rectangle.selectSingleNode("y"); //$NON-NLS-1$ if( tmpNode !=null ) { y=Integer.parseInt(tmpNode.getText().toString().trim());//$NON-NLS-1$ } }Rectangle2D rect = new Rectangle2D.Double(x,y,rectWidth,rectHeight);return new TexturePaint(image,rect); }}catch(Exception e){e.printStackTrace();} return null; } |
getGradientPaint | public static Paint getGradientPaint(Node gradientNode, int width, int height)(Code) | | Parameters: gradientNode - root node that hold gradient information a gradientPaint implementation of Paint |
getImage | public static Image getImage(Node chartBackgroundImageNode, IPentahoSession session)(Code) | | Parameters: chartBackgroundImageNode - -Node that contains a path to the images in its text element the image |
getLineStyleStroke | public static Stroke getLineStyleStroke(String lineStyle, float lineWidth)(Code) | | |
getPaint | public static Paint getPaint(Node node, int width, int height, IPentahoSession session)(Code) | | Creates a java.awt.Paint object from an XML node from the dial definition
document
Parameters: width - of the chart Parameters: height - of the chart Parameters: node - XML Node from the dial definition Paint object defined by the node |
getPaint | public static Paint getPaint(Node node)(Code) | | Creates a java.awt.Paint object from an XML node from the dial definition
document
Parameters: node - XML Node from the chart definition Paint object defined by the node |
getPaint | public static Paint getPaint(String htmlColor)(Code) | | Creates a java.awt.Paint object from an HTML color definition, eg #80ff3f
Parameters: htmlColor - The color string Paint The Paint object for the requested color |
getTexturePaint | public static Paint getTexturePaint(Node textureNode, int width, int height, IPentahoSession session)(Code) | | Parameters: textureNode - root node that holds texture information |
getTransparent | public static Color getTransparent()(Code) | | |
isBarColumn | public static boolean isBarColumn(String[] barColumns, String columnName)(Code) | | |
isLineColumn | public static boolean isLineColumn(String[] lineColumns, String columnName)(Code) | | |
saveChart | public static void saveChart(Dataset dataset, String title, String units, String fileName, int width, int height, int outputType, PrintWriter writer, ILogger logger)(Code) | | Create an image file using dataset object. This method takes a dataset
object, e.g. a DialWidgetDefinition, creates a JFreeChart object from it,
and then creates an image file.
Parameters: dataset - The Parameters: title - The title of the chart Parameters: units - The units of the chart value Parameters: fileName - The path and file of the image to create Parameters: width - The width of the image to create Parameters: height - The height of the image to create Parameters: outputType - The type of the image to create Parameters: writer - A writer to writer the image map into Parameters: logger - The logger to log any messages to |
saveChart | public static void saveChart(Dataset dataset, String title, String units, String fileName, int width, int height, int outputType, PrintWriter writer, ChartRenderingInfo info, ILogger logger)(Code) | | Create an image file using dataset object. This method takes a dataset
object, e.g. a DialWidgetDefinition, creates a JFreeChart object from it,
and then creates an image file.
Parameters: dataset - The Parameters: title - The title of the chart Parameters: units - The units of the chart value Parameters: fileName - The path and file of the image to create Parameters: width - The width of the image to create Parameters: height - The height of the image to create Parameters: outputType - The type of the image to create Parameters: writer - A writer to writer the image map into Parameters: logger - The logger to log any messages to |
|
|