ChartCat 1.2

li.netcat.chart.util
Class BarPart

java.lang.Object
  extended byli.netcat.chart.util.AbstractPart
      extended byli.netcat.chart.util.GraphPart
          extended byli.netcat.chart.util.CartesianGraphPart
              extended byli.netcat.chart.util.BarPart
All Implemented Interfaces:
Part

public class BarPart
extends CartesianGraphPart

Represents a bar graph that looks for example like this:

The gaps between the bars are defined relative to the bar width.

Author:
Arthur Marxer

Field Summary
 
Fields inherited from class li.netcat.chart.util.CartesianGraphPart
HORIZONTAL, VERTICAL
 
Fields inherited from class li.netcat.chart.util.GraphPart
STACK_STRATEGY_APPEND, STACK_STRATEGY_GROUP, STACK_TYPE_NOT_STACKED, STACK_TYPE_STACKED, STACK_TYPE_STACKED_PERCENT
 
Fields inherited from class li.netcat.chart.util.AbstractPart
BACKGROUND, FOREGROUND, PERSPECTIVE
 
Constructor Summary
BarPart(ChartModel model)
          Constructs a new BarPart using the given ChartModel, the type STACK_TYPE_NOT_STACKED and a horizontal orientation.
BarPart(ChartModel model, int stackType, int orientation)
          Constructs a new BarPart using the given ChartModel, stack type and orientation.
 
Method Summary
 Layout getLayout(java.awt.Graphics g)
          Returns an instance of a layout that is able to report the bounds of this part and is able to paint this part.
 float getRelativeColumnGap()
          Returns the relative gap of two side by side bars of succeeding columns.
 float getRelativeRowGap()
          Returns the relative gap of two side by side bars of succeeding rows.
 ValueLocation getValueLocation(int rowIndex, int columnIndex)
          Abstract function that calculates a ValueLocation for a given cell.
 void invalidate()
          Calls invalidate() on the chart context if it's not null.
 void setRelativeColumnGap(float gap)
          Sets the relative gap of two side by side bars of succeeding columns.
 void setRelativeRowGap(float gap)
          Sets the relative gap of two side by side bars of succeeding rows.
 
Methods inherited from class li.netcat.chart.util.CartesianGraphPart
getHeight, getHorizontalScaleModel, getOrientation, getVerticalScaleModel, getWidth, setHorizontalScaleModel, setOrientation, setSize, setVerticalScaleModel
 
Methods inherited from class li.netcat.chart.util.GraphPart
getChartModel, getDiscreetLength, getDiscreetScaleModel, getGraphLook, getLegendModel, getNumericLength, getNumericScaleModel, getStackModel, setChartModel, setDiscreetLength, setDiscreetScaleModel, setGraphLook, setLegendModel, setNumericLength, setNumericScaleModel, setStackModel
 
Methods inherited from class li.netcat.chart.util.AbstractPart
getChart, getPerspective, setChart, setPerspective
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BarPart

public BarPart(ChartModel model)
Constructs a new BarPart using the given ChartModel, the type STACK_TYPE_NOT_STACKED and a horizontal orientation.

Parameters:
model - The ChartModel that provides the data. null will be replaced by an empty ChartModel.

BarPart

public BarPart(ChartModel model,
               int stackType,
               int orientation)
Constructs a new BarPart using the given ChartModel, stack type and orientation.

Parameters:
model - The ChartModel that provides the data. null will be replaced by an empty ChartModel.
stackType - The type of the resulting graph. Specify one of STACK_TYPE_NOT_STACKED, STACK_TYPE_STACKED or STACK_TYPE_STACKED_PERCENT.
orientation - The orientation of the resulting graph. Specify HORIZONTAL or VERTICAL.
Method Detail

getRelativeColumnGap

public float getRelativeColumnGap()
Returns the relative gap of two side by side bars of succeeding columns. A gap of 1.0f is as wide as a bar. This parameter is only used in connection with the graph type STACK_TYPE_NOT_STACKED.

Returns:
The relative column gap, the default is 0.0f.

setRelativeColumnGap

public void setRelativeColumnGap(float gap)
Sets the relative gap of two side by side bars of succeeding columns. A gap of 1.0f is as wide as a bar. This parameter is only used in connection with the graph type STACK_TYPE_NOT_STACKED.

Parameters:
gap - The relative column gap.

getRelativeRowGap

public float getRelativeRowGap()
Returns the relative gap of two side by side bars of succeeding rows. A gap of 1.0f is as wide as a bar.

Returns:
The relative row gap, the default is 1.0f.

setRelativeRowGap

public void setRelativeRowGap(float gap)
Sets the relative gap of two side by side bars of succeeding rows. A gap of 1.0f is as wide as a bar.

Parameters:
gap - The relative column gap.

getValueLocation

public ValueLocation getValueLocation(int rowIndex,
                                      int columnIndex)
Description copied from class: GraphPart
Abstract function that calculates a ValueLocation for a given cell.

Overrides:
getValueLocation in class CartesianGraphPart

getLayout

public Layout getLayout(java.awt.Graphics g)
Description copied from interface: Part
Returns an instance of a layout that is able to report the bounds of this part and is able to paint this part.

Parameters:
g - The relevant graphics object.
Returns:
A layout that is able to report the bounds of this part and is able to paint this part. This method may also return null.

invalidate

public void invalidate()
Description copied from class: AbstractPart
Calls invalidate() on the chart context if it's not null.

Overrides:
invalidate in class AbstractPart

ChartCat 1.2

Copyright 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print