com.davisor.graphics.chart
Class BarFactory.BarMetrics
java.lang.Object
com.davisor.graphics.chart.ChartFactory.ChartMetrics
com.davisor.graphics.chart.AxisFactory.AxisMetrics
com.davisor.graphics.chart.BarFactory.BarMetrics
- Enclosing class:
- BarFactory
- public class BarFactory.BarMetrics
- extends AxisFactory.AxisMetrics
BarMetrics implements bar chart spesific axis metrics. In
particular, there is bar chart spesific relationship between plot
offsets and core area size, since half of the edgemost bars in
bar charts hang outside the core drawing area.
- See Also:
computeCoreSize(int),
getGroupSize(),
setCoreSize(float[])
| Fields inherited from class com.davisor.graphics.chart.AxisFactory.AxisMetrics |
M_ax, M_axisOffset, M_ay, M_clip, M_coreSize, M_labelOffset, M_labelSize, M_majorEdge, M_markerOffset, M_markerSize, M_minorEdge, M_opposite, M_origo, M_plotOffset, M_reverse, M_rotSize, M_symbolOffset, M_titleOffset, M_titleSize |
|
Constructor Summary |
BarFactory.BarMetrics(ChartAxes axes,
float chartWidth,
float chartHeight,
float[] titleSize,
float[] labelSize,
float[] markerSize,
float[] axisOffset,
float[] labelOffset,
float[] markerOffset,
float[] symbolOffset,
float[] majorEdge,
float[] minorEdge,
float[] rotSize)
Creates a new internal axis info bundle. |
|
Method Summary |
protected void |
computeCoreSize(int dim)
Computes coordinate back area size. |
float |
getGroupSize()
Gets bar group size for this metrics. |
void |
setCoreSize(float[] coreSize)
Sets metrics core size.
|
| Methods inherited from class com.davisor.graphics.chart.AxisFactory.AxisMetrics |
clip, computeClip, getAxisOffset, getAxisSize, getAxisSize, getBackSize, getBottomMargin, getCoreSize, getLabelOffset, getLabelSize, getLeftMargin, getMajorEdge, getMajorMargin, getMargins, getMarkerOffset, getMarkerSize, getMinorEdge, getMinorMargin, getMinorMargin, getOrigo, getPlotOffset, getPlotSize, getPlotSize, getRightMargin, getRotSize, getRotSize, getSymbolOffset, getSymbolSize, getSymbolSize, getTitleOffset, getTitleSize, getTopMargin, getXOrient, getYOrient, init, isOpposite, modifySize, scale, scale, scaleToSize, setAxisOffset, setAxisSize, setLabelOffset, setLabelSize, setMajorEdge, setMarkerOffset, setMarkerSize, setMinorEdge, setMinorMargin, setOrigo, setOrigo, setPlotOffset, setPlotOffset, setPlotOffset, setRotSize, setSize, setSize, setSymbolOffset, setSymbolSize, setTitleOffset, setTitleSize, setXOrient, setYOrient, toString, x, y |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
categoryAxis
protected ChartAxis categoryAxis
BarFactory.BarMetrics
public BarFactory.BarMetrics(ChartAxes axes,
float chartWidth,
float chartHeight,
float[] titleSize,
float[] labelSize,
float[] markerSize,
float[] axisOffset,
float[] labelOffset,
float[] markerOffset,
float[] symbolOffset,
float[] majorEdge,
float[] minorEdge,
float[] rotSize)
- Creates a new internal axis info bundle.
- Parameters:
axes - chart axeschartWidth - chart width, stricly within chart borderschartHeight - chart height, stricly within chart borderstitleSize - title area sizelabelSize - label area sizeaxisOffset - axis offsetslabelOffset - label offsetssymbolOffset - symbol offsetsmajorEdge - major edge sizeminorEdge - minor margin (see above)rotSize - isometric area size- See Also:
AxisFactory.AxisMetrics.init(com.davisor.graphics.chart.ChartAxes, float[], float[], float[], float[], float[], float[], float[], float[], float[], float[])
computeCoreSize
protected void computeCoreSize(int dim)
- Computes coordinate back area size. The size is whatever is left
when 3D shear size and plot offsets are substracted from the total
plot area size.
Y
|_:_ _:_ _:_
| : | : | | : |
0-+---+--...--+-- X
0 1 N
<---------------> plotSize
<-----------> coreSize
<---> groupSize (= space between datapoints)
<---> (= group width)
<-> plotOffset (= plotSize / (N+1))
<-> (= groupSize / 2)
Please note, that if there is just one bar (N=0), groupSize
becomes zero, and plotOffset will be equal to plotSize / 2.
Y
|_:_
| : |
0-+-- X
0
<---> plotSize
. coreSize
. groupSize (= space between datapoints)
. (= group width)
<-> plotOffset (= plotSize / (N+1))
<-> (= groupSize / 2)
Bar chart metrics speciality is, that setting core size affects plot
offset, too, as first and last bar hang half out.
- Overrides:
computeCoreSize in class AxisFactory.AxisMetrics
- See Also:
AxisFactory.AxisMetrics.getPlotSize(int)
setCoreSize
public void setCoreSize(float[] coreSize)
- Sets metrics core size.
Bar chart metrics speciality is, that setting core size affects plot
offset, too, as first and last bar hang half out.
- Overrides:
setCoreSize in class AxisFactory.AxisMetrics
getGroupSize
public float getGroupSize()
- Gets bar group size for this metrics. The bar group size is a
function of current category axis core size, and the number of
steps along that axis.
If there are two or more bars, group size equals the width of
the core area divided by the number of steps between bars. If
there is just one bar, core area has zero size, and group size
equals the sum of plot offset sizes.
- Returns:
- bar group size in device coordinates
- See Also:
BarFactory.getCategoryAxis(),
ChartAxis.getSteps()
Copyright © 2001-2004 Davisor Oy. All Rights Reserved.