com.pdfjet
Class Chart

java.lang.Object
  extended by com.pdfjet.Chart

public class Chart
extends java.lang.Object

Used to create XY chart objects and draw them on a page. Please see Example_09.


Constructor Summary
Chart(Font f1, Font f2)
          Create a XY chart object.
 
Method Summary
 void drawOn(Page page)
          Draws this chart on the specified page.
 java.util.List<java.util.List<Point>> getData()
          Returns the chart data.
 float intercept(java.util.List<Point> points, double slope)
          Calculates the intercept of a trend line given a list of points.
 float intercept(java.util.List<Point> points, float slope)
          Calculates the intercept of a trend line given a list of points.
 void setData(java.util.List<java.util.List<Point>> chartData)
          Sets the data that will be used to draw this chart.
 void setDrawXAxisLabels(boolean drawXAxisLabels)
           
 void setDrawYAxisLabels(boolean drawYAxisLabels)
           
 void setLocation(float x, float y)
          Sets the location of this chart on the page.
 void setMaximumFractionDigits(int maxFractionDigits)
          Sets the maximum number of fractions digits do display for the X and Y axis labels.
 void setMinimumFractionDigits(int minFractionDigits)
          Sets the minimum number of fractions digits do display for the X and Y axis labels.
 void setPosition(double x, double y)
          Sets the position of this chart on the page.
 void setPosition(float x, float y)
          Sets the position of this chart on the page.
 void setSize(double w, double h)
          Sets the size of this chart.
 void setSize(float w, float h)
          Sets the size of this chart.
 void setTitle(java.lang.String title)
          Sets the title of the chart.
 void setXAxisTitle(java.lang.String title)
          Sets the title for the X axis.
 void setYAxisTitle(java.lang.String title)
          Sets the title for the Y axis.
 float slope(java.util.List<Point> points)
          Calculates the slope of a trend line given a list of points.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chart

public Chart(Font f1,
             Font f2)
Create a XY chart object.

Parameters:
f1 - the font used for the chart title.
f2 - the font used for the X and Y axis titles.
Method Detail

setTitle

public void setTitle(java.lang.String title)
Sets the title of the chart.

Parameters:
title - the title text.

setXAxisTitle

public void setXAxisTitle(java.lang.String title)
Sets the title for the X axis.

Parameters:
title - the X axis title.

setYAxisTitle

public void setYAxisTitle(java.lang.String title)
Sets the title for the Y axis.

Parameters:
title - the Y axis title.

setData

public void setData(java.util.List<java.util.List<Point>> chartData)
Sets the data that will be used to draw this chart.

Parameters:
chartData - the data.

getData

public java.util.List<java.util.List<Point>> getData()
Returns the chart data.

Returns:
the chart data.

setPosition

public void setPosition(double x,
                        double y)
Sets the position of this chart on the page.

Parameters:
x - the x coordinate of the top left corner of this chart when drawn on the page.
y - the y coordinate of the top left corner of this chart when drawn on the page.

setPosition

public void setPosition(float x,
                        float y)
Sets the position of this chart on the page.

Parameters:
x - the x coordinate of the top left corner of this chart when drawn on the page.
y - the y coordinate of the top left corner of this chart when drawn on the page.

setLocation

public void setLocation(float x,
                        float y)
Sets the location of this chart on the page.

Parameters:
x - the x coordinate of the top left corner of this chart when drawn on the page.
y - the y coordinate of the top left corner of this chart when drawn on the page.

setSize

public void setSize(double w,
                    double h)
Sets the size of this chart.

Parameters:
w - the width of this chart.
h - the height of this chart.

setSize

public void setSize(float w,
                    float h)
Sets the size of this chart.

Parameters:
w - the width of this chart.
h - the height of this chart.

setMinimumFractionDigits

public void setMinimumFractionDigits(int minFractionDigits)
Sets the minimum number of fractions digits do display for the X and Y axis labels.

Parameters:
minFractionDigits - the minimum number of fraction digits.

setMaximumFractionDigits

public void setMaximumFractionDigits(int maxFractionDigits)
Sets the maximum number of fractions digits do display for the X and Y axis labels.

Parameters:
maxFractionDigits - the maximum number of fraction digits.

slope

public float slope(java.util.List<Point> points)
Calculates the slope of a trend line given a list of points. See Example_09.

Parameters:
points - the list of points.
Returns:
the slope float value.

intercept

public float intercept(java.util.List<Point> points,
                       double slope)
Calculates the intercept of a trend line given a list of points. See Example_09.

Parameters:
points - the list of points.
Returns:
the intercept float value.

intercept

public float intercept(java.util.List<Point> points,
                       float slope)
Calculates the intercept of a trend line given a list of points. See Example_09.

Parameters:
points - the list of points.
Returns:
the intercept float value.

setDrawXAxisLabels

public void setDrawXAxisLabels(boolean drawXAxisLabels)

setDrawYAxisLabels

public void setDrawYAxisLabels(boolean drawYAxisLabels)

drawOn

public void drawOn(Page page)
            throws java.lang.Exception
Draws this chart on the specified page.

Parameters:
page - the page to draw this chart on.
Throws:
java.lang.Exception