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

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

Introduction

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

Prototype

public CanvasGraphics2D(String canvasID) 

Source Link

Document

Creates a new instance.

Usage

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

/**
 * Starting point for the demo.//  ww w. j  ava  2s . 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  av 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.// www  .  j ava 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;
    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());
}