Example usage for org.jfree.graphics2d.canvas CanvasGraphics2D getScript

List of usage examples for org.jfree.graphics2d.canvas CanvasGraphics2D getScript

Introduction

In this page you can find the example usage for org.jfree.graphics2d.canvas CanvasGraphics2D getScript.

Prototype

public String getScript() 

Source Link

Document

Returns the script that has been generated by calls to this Graphics2D implementation.

Usage

From source file:org.jfree.graphics2d.demo.CanvasPieChartDemo1.java

/**
 * Starting point for the demo.//from ww w .  j a v  a 2  s .  c om
 * 
 * @param args  ignored.
 * 
 * @throws IOException 
 */
public static void main(String[] args) throws IOException {
    JFreeChart chart = createChart(createDataset());
    CanvasGraphics2D g2 = new CanvasGraphics2D("id");
    int width = 600;
    int height = 400;
    chart.draw(g2, new Rectangle(0, 0, width, height));
    File f = new File("CanvasPieChartDemo1.html");
    CanvasUtils.writeToHTML(f, "CanvasPieChartDemo1", g2.getCanvasID(), width, height, g2.getScript());
}

From source file:org.jfree.graphics2d.demo.CanvasBarChartDemo1.java

/**
 * Starting point for the demo./*from  w w  w.  j  a  v a  2 s  .  c  o  m*/
 * 
 * @param args  ignored.
 * 
 * @throws IOException 
 */
public static void main(String[] args) throws IOException {
    JFreeChart chart = createChart(createDataset());
    CanvasGraphics2D g2 = new CanvasGraphics2D("id");
    int width = 600;
    int height = 400;
    Rectangle r = new Rectangle(0, 0, width, height);
    chart.draw(g2, r);
    File f = new File("CanvasBarChartDemo1.html");
    CanvasUtils.writeToHTML(f, "CanvasBarChartDemo1", g2.getCanvasID(), width, height, g2.getScript());
}

From source file:org.jfree.graphics2d.demo.CanvasTimeSeriesChartDemo1.java

/**
 * Starting point for the demo.//from w w  w  .  ja va 2 s.c  om
 * 
 * @param args  ignored.
 * 
 * @throws IOException 
 */
public static void main(String[] args) throws IOException {
    JFreeChart chart = createChart(createDataset());
    CanvasGraphics2D g2 = new CanvasGraphics2D("id");
    int width = 600;
    int height = 400;
    chart.draw(g2, new Rectangle(0, 0, width, height));
    File f = new File("CanvasTimeSeriesChartDemo1.html");
    CanvasUtils.writeToHTML(f, "CanvasTimeSeriesChartDemo1", g2.getCanvasID(), width, height, g2.getScript());
}