java.lang.Objectcom.pdfjet.Chart
public class Chart
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 |
|---|
public Chart(Font f1,
Font f2)
f1 - the font used for the chart title.f2 - the font used for the X and Y axis titles.| Method Detail |
|---|
public void setTitle(java.lang.String title)
title - the title text.public void setXAxisTitle(java.lang.String title)
title - the X axis title.public void setYAxisTitle(java.lang.String title)
title - the Y axis title.public void setData(java.util.List<java.util.List<Point>> chartData)
chartData - the data.public java.util.List<java.util.List<Point>> getData()
public void setPosition(double x,
double y)
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.
public void setPosition(float x,
float y)
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.
public void setLocation(float x,
float y)
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.
public void setSize(double w,
double h)
w - the width of this chart.h - the height of this chart.
public void setSize(float w,
float h)
w - the width of this chart.h - the height of this chart.public void setMinimumFractionDigits(int minFractionDigits)
minFractionDigits - the minimum number of fraction digits.public void setMaximumFractionDigits(int maxFractionDigits)
maxFractionDigits - the maximum number of fraction digits.public float slope(java.util.List<Point> points)
points - the list of points.
public float intercept(java.util.List<Point> points,
double slope)
points - the list of points.
public float intercept(java.util.List<Point> points,
float slope)
points - the list of points.
public void setDrawXAxisLabels(boolean drawXAxisLabels)
public void setDrawYAxisLabels(boolean drawYAxisLabels)
public void drawOn(Page page)
throws java.lang.Exception
page - the page to draw this chart on.
java.lang.Exception