public abstract class VanChartBaseAxisGlyph extends AxisGlyph
限定符和类型 | 字段和说明 |
---|---|
static int |
DEFAULT_MAX |
protected double |
niceMaxValue |
protected double |
niceMinValue |
static double |
TICK_COUNT |
axisGridLength, axisLabelWidth, axisLength, axisReversed, bounds, DEFAULT_SAMPLING_TIME, DEFAULT_UNIT, endLabelDim, format, isArrowShow, isCustomMaxValue, isCustomMinValue, isLabelWrap, isShowAxisLabel, labelNumber, lineColor, lineStyle, MAIN_TICK_LENGTH, mainGridColor, mainGridStyle, mainUnit, MAX_AXIS_LABEL_HEIGHT, MAX_AXIS_LABEL_WIDTH, maxValue, MIN_TICK_LENGTH, minValue, originPoint, PIE_ANGLE, plotLastBounds, plotZeroBounds, position, SEC_TICK_LENGTH, secTickMarkType, startLabelDim, textAttr, threeDBase, TICK_WIDTH, tickMarkType, titleDim, titleGlyph, TOP_AND_DOWN_GAP, unitLength, VERTICAL_ANGLE
构造器和说明 |
---|
VanChartBaseAxisGlyph() |
限定符和类型 | 方法和说明 |
---|---|
protected void |
addAxisLabelJSON(JSONObject js,
Repository repo) |
protected void |
addMinMaxValue(JSONObject js,
Repository repo) |
protected void |
addValueFormat(JSONObject js,
Repository repo) |
void |
calculateBoundsWidthOrientationAndTitle(java.awt.geom.Rectangle2D plotBounds,
double cateLabelWidth,
java.awt.geom.Dimension2D titleDim)
预计算纵轴 标签高度 和 横轴标签宽度 对Plot高度 和宽度的 影响
|
protected void |
calculateTitleDimesion(int resolution) |
protected void |
calculateValueTimeNiceDomain(boolean fromZero,
boolean adjustMinMax,
double minValue,
double maxValue) |
protected java.awt.geom.Rectangle2D |
calculatorTitleBounds(int resolution)
计算坐标轴标题的Bounds 相对AxisGlyph的绝对位置.
|
void |
dealOnZeroAxisGlyphLocation(double verticalZero)
处理0值对齐
|
void |
draw(java.awt.Graphics g,
int resolution)
画出坐标轴的相关元素
|
protected void |
drawAfterPlot4AlertValues(java.awt.Graphics2D g2d,
int resolution)
在绘图区之后 画警戒线
|
void |
drawAlertValueGlyph(java.awt.Graphics2D g2d,
int resolution) |
protected void |
drawAxisLine(java.awt.Graphics g,
int resolution)
画坐标轴的线
|
protected void |
drawAxisTitle(java.awt.Graphics g,
int resolution)
画坐标轴标题
|
protected void |
drawIntervalBackground(java.awt.Graphics g) |
protected void |
drawLabel(java.awt.Graphics g,
double value,
double offset,
java.lang.String labelString,
java.awt.geom.GeneralPath labelPath,
int resolution) |
protected void |
drawLabel(java.awt.Graphics g,
double value,
double offset,
java.lang.String labelString,
int resolution)
最终的坐标轴标签画法
|
void |
finallyUpdateAxisGridLength(double length) |
java.awt.geom.Point2D |
getAlertValuePoint(java.lang.Object ob)
对象在坐标轴的位置,category、time、value。
|
java.util.List<VanChartAlertValueGlyph> |
getAlertValues() |
int |
getCategoryNum() |
protected double |
getCateLabelWidth(java.awt.geom.Rectangle2D plotBounds,
int resolution) |
protected java.awt.Shape |
getCustomBackgroundShape(double startValue,
double endValue,
boolean isCustom) |
java.util.List<VanChartCustomIntervalBackground> |
getCustomIntervalBackgroundArray() |
java.awt.Color |
getDefaultIntervalBackgroundColor() |
double |
getDefaultTickCount() |
protected double |
getLeftRightY(int titlePosition) |
AxisTickLineType |
getMainTickLine() |
double |
getMaxHeight()
返回区域最大占比
|
protected double |
getMaxTickValue() |
double |
getNiceMaxValue() |
double |
getNiceMinValue() |
java.lang.Object |
getObjectFromFormula(BaseFormula formula) |
double |
getObjectValue(java.lang.Object ob) |
protected double |
getOtherPoint2ValueLength(java.awt.geom.Point2D startPoint,
java.awt.geom.Point2D endPoint) |
protected java.awt.geom.Line2D |
getOtherPositionGridLine(java.awt.geom.Point2D centerP) |
protected java.awt.geom.Rectangle2D |
getOtherPositionLabelBounds(java.awt.geom.Point2D centerP,
double width,
double height,
double margin) |
protected java.awt.geom.Line2D |
getOtherPositionTickLine(java.awt.geom.Point2D centerP,
java.awt.geom.Point2D bottomP,
java.awt.geom.Point2D leftP) |
protected java.awt.geom.Rectangle2D |
getOtherPositionTitleBounds(java.awt.geom.Dimension2D dim,
int titlePosition) |
java.awt.geom.Point2D |
getPoint2D(double value)
得到坐标轴上值所对应的坐标轴点.
|
AxisTickLineType |
getSecTickLine() |
protected double |
getTickLengthShow()
返回刻度 展示的长度
|
protected java.awt.geom.Line2D |
getTickLine(double value,
int tickLength,
AxisTickLineType tickLineType)
获取刻度线
|
protected java.awt.geom.Line2D |
getTickLineByCenterPoint(java.awt.geom.Point2D centerP,
int tickLength,
AxisTickLineType tickLineType) |
java.awt.geom.Point2D |
getValuePoint(java.lang.Object ob)
对象在坐标轴的位置,category、time、value
|
java.lang.String |
getVanAxisName() |
AxisType |
getVanAxisType() |
protected void |
gridLineToJSON(JSONObject js) |
protected void |
init(java.awt.geom.Rectangle2D plotBounds)
初始化坐标轴的边界
|
void |
initAxisGlyphStartPoint(java.awt.geom.Rectangle2D bounds)
绘图区依次布局所有坐标轴过程中绘图区边界,和最终绘图区边界比较后得到最终坐标轴相对最终绘图区的位置
|
void |
initMinMaxValue(double autoMin,
double autoMax,
boolean adjustMinMax)
初始化坐标轴的最大值和最小值
|
boolean |
isAutoLabelGap()
自动间隔
|
boolean |
isCommonValueFormat()
通用数据格式
|
protected boolean |
isHorizontalAxis()
判断坐标轴是否在水平方向,
即判断是否为横轴
|
boolean |
isLimitSize()
返回是否限制区域大小
|
protected boolean |
isRevertAndArrow() |
boolean |
isRotation() |
boolean |
isTitleUseHtml()
标题使用html
|
protected boolean |
isXAdd() |
boolean |
isYAdd()
y的坐标值是加还是减,分两种情况
坐标轴转置但不旋转
旋转但坐标轴不转置
|
void |
notShowAllAttr()
特定情况下 不展示坐标轴标签 标题 刻度 , 目前只针对数据表显示时, 分类轴不显示.
|
void |
setAlertValues(java.util.List<VanChartAlertValueGlyph> alertValues) |
void |
setAutoLabelGap(boolean autoLabelGap) |
void |
setCategoryNum(int categoryNum) |
void |
setChartBounds(java.awt.geom.Rectangle2D chartBounds) |
void |
setCommonValueFormat(boolean commonValueFormat) |
void |
setCustomIntervalBackgroundArray(java.util.List<VanChartCustomIntervalBackground> customIntervalBackgroundArray) |
void |
setCustomMaxValue(double customMaxValue) |
void |
setCustomMinValue(double customMinValue) |
void |
setDefaultIntervalBackgroundColor(java.awt.Color defaultIntervalBackgroundColor) |
void |
setHtmlLabel(VanChartHtmlLabel htmlLabel) |
void |
setISXAxis(boolean isXAxis) |
void |
setLimitSize(boolean limitSize)
设置是否限制区域大小
|
void |
setMainTickLine(AxisTickLineType mainTickLine) |
void |
setMaxHeight(double maxHeight)
设置区域最大占比
|
protected void |
setMinMaxTickInterval(double min,
double max,
double tickInterval) |
void |
setNiceMaxValue(double niceMaxValue) |
void |
setNiceMinValue(double niceMinValue) |
void |
setRotation(boolean isRotation) |
void |
setSecTickLine(AxisTickLineType secTickLine) |
void |
setTitleUseHtml(boolean titleUseHtml) |
void |
setVanAxisName(java.lang.String vanAxisName) |
void |
setVanAxisType(AxisType axisType) |
protected boolean |
shouldBeHeight()
是否是横轴
|
protected boolean |
shouldDrawTickLine(java.awt.geom.Line2D line) |
JSONObject |
toJSONObject(Repository repo)
转为json数据
|
calBoundsWithMoreLabel4Cate, calculateAxisGlyph, calculateAxisLengthUnit, calculateLocationWithEllipsis, changeAxisLabelStringWithLabelBounds, dealPlotBoundsWithAxisLabel, dealPlotBoundsWithAxisTitle, dealPlotBoundsWithLabel, dealPlotBoundsWithLabelInHorizontal, dealWithPlotBounds, draw4ThreeD, drawArrow, drawAxisGrid, drawLabelWrapWhenNeed, drawTickLine, drawTicks, drawWithOutAlert, equals, get2ValueLength, getArrowValue, getAxisGridLength, getAxisLabelDim, getAxisLabelWidth, getAxisLabelWidth, getAxisLength, getAxisName, getAxisType, getBigDecimalMainUnit, getBottomTitleBounds, getBounds, getCrossValue, getCrossValueInPlot, getCubic, getDivideUnit, getFormat, getGridLine, getJSAxisType, getLabelBounds, getLabelBounds4WrapWhenAxisLeftOrRight, getLabelNumber, getLeftTitleBounds, getLineColor, getLineStyle, getMainGridColor, getMainGridStyle, getMainUnit, getMaxLabelWidthAndInitStartEndLabelDim, getMaxValue, getMinValue, getOrigin, getPlotLastBounds, getPlotZeroBounds, getPointInBounds, getPosition, getPreLeftWidth4DataSheet, getRightTitleBounds, getSecTickMarkType, getSecUnit, getShape, getShowUnit, getTextAttr, getThreeDBase, getTickIndex4Value, getTickLine, getTickLineByCenterPoint, getTickMarkType, getTickSamplingTime, getTitleDim, getTopBottomX, getTopTitleBounds, getUnitLen, getVanAxisStringType, hasAxisReversed, initMinMaxValue, isArrowShow, isCustomMainUnit, isCustomMaxValue, isCustomMinValue, isCustomSecUnit, isDrawBetweenTick, isHorizontal, isLog, isPercentage, isShowAxisLabel, isZoom, setArrowShow, setAttr, setAxisGridLength, setAxisLabelWidth, setAxisLength, setAxisReversed, setAxisType, setBounds, setCubic, setCustomMainUnit, setCustomMaxValue, setCustomMinValue, setCustomSecUnit, setDrawBetweenTick, setFormat, setLabelNumber, setLabelWrap, setLineColor, setLineStyle, setLog, setMainGridColor, setMainGridStyle, setMainUnit, setMaxValue, setMinMaxValue, setMinValue, setOrigin, setPlotZeroBounds, setPosition, setSecTickMarkType, setSecUnit, setShowAxisLabel, setTextAttr, setThreeDBase, setTickMarkType, setTitleGlyph, setUnitLen, setZoom, toVanJSONObject, value2String
clone, selectableChildren
public static final double TICK_COUNT
public static final int DEFAULT_MAX
protected double niceMinValue
protected double niceMaxValue
public boolean isRotation()
public void setRotation(boolean isRotation)
public void setCustomMinValue(double customMinValue)
public void setCustomMaxValue(double customMaxValue)
public void setNiceMinValue(double niceMinValue)
public void setNiceMaxValue(double niceMaxValue)
public double getNiceMinValue()
public double getNiceMaxValue()
public void setMainTickLine(AxisTickLineType mainTickLine)
public void setSecTickLine(AxisTickLineType secTickLine)
public AxisTickLineType getSecTickLine()
public AxisTickLineType getMainTickLine()
public void setVanAxisName(java.lang.String vanAxisName)
public java.lang.String getVanAxisName()
public void setISXAxis(boolean isXAxis)
public void setChartBounds(java.awt.geom.Rectangle2D chartBounds)
public void setTitleUseHtml(boolean titleUseHtml)
public int getCategoryNum()
public void setCategoryNum(int categoryNum)
public boolean isTitleUseHtml()
public void setAutoLabelGap(boolean autoLabelGap)
public boolean isAutoLabelGap()
public void setCommonValueFormat(boolean commonValueFormat)
public boolean isCommonValueFormat()
public void setHtmlLabel(VanChartHtmlLabel htmlLabel)
public void setAlertValues(java.util.List<VanChartAlertValueGlyph> alertValues)
public java.util.List<VanChartAlertValueGlyph> getAlertValues()
public void setCustomIntervalBackgroundArray(java.util.List<VanChartCustomIntervalBackground> customIntervalBackgroundArray)
public void setDefaultIntervalBackgroundColor(java.awt.Color defaultIntervalBackgroundColor)
public java.util.List<VanChartCustomIntervalBackground> getCustomIntervalBackgroundArray()
public java.awt.Color getDefaultIntervalBackgroundColor()
public void setLimitSize(boolean limitSize)
limitSize
- 是否限制区域大小public boolean isLimitSize()
public void setMaxHeight(double maxHeight)
maxHeight
- 区域最大占比public double getMaxHeight()
public void setVanAxisType(AxisType axisType)
public AxisType getVanAxisType()
public double getDefaultTickCount()
public void notShowAllAttr()
notShowAllAttr
在类中 AxisGlyph
public void draw(java.awt.Graphics g, int resolution)
public void initMinMaxValue(double autoMin, double autoMax, boolean adjustMinMax)
autoMin
- 自动计算后是否调整最大最小值(柱形图x轴为数值或者时间)autoMax
- 最小值adjustMinMax
- 最大值public java.awt.geom.Point2D getPoint2D(double value)
getPoint2D
在类中 AxisGlyph
protected boolean isHorizontalAxis()
public boolean isYAdd()
protected boolean isXAdd()
protected java.awt.geom.Line2D getOtherPositionGridLine(java.awt.geom.Point2D centerP)
getOtherPositionGridLine
在类中 AxisGlyph
protected java.awt.geom.Rectangle2D getOtherPositionTitleBounds(java.awt.geom.Dimension2D dim, int titlePosition)
getOtherPositionTitleBounds
在类中 AxisGlyph
protected java.awt.geom.Line2D getOtherPositionTickLine(java.awt.geom.Point2D centerP, java.awt.geom.Point2D bottomP, java.awt.geom.Point2D leftP)
getOtherPositionTickLine
在类中 AxisGlyph
protected java.awt.geom.Rectangle2D getOtherPositionLabelBounds(java.awt.geom.Point2D centerP, double width, double height, double margin)
getOtherPositionLabelBounds
在类中 AxisGlyph
protected double getOtherPoint2ValueLength(java.awt.geom.Point2D startPoint, java.awt.geom.Point2D endPoint)
getOtherPoint2ValueLength
在类中 AxisGlyph
protected double getLeftRightY(int titlePosition)
getLeftRightY
在类中 AxisGlyph
protected boolean shouldBeHeight()
shouldBeHeight
在类中 AxisGlyph
protected double getCateLabelWidth(java.awt.geom.Rectangle2D plotBounds, int resolution)
getCateLabelWidth
在类中 AxisGlyph
public void calculateBoundsWidthOrientationAndTitle(java.awt.geom.Rectangle2D plotBounds, double cateLabelWidth, java.awt.geom.Dimension2D titleDim)
calculateBoundsWidthOrientationAndTitle
在类中 AxisGlyph
plotBounds
- 边界cateLabelWidth
- 宽度titleDim
- 大小public void initAxisGlyphStartPoint(java.awt.geom.Rectangle2D bounds)
bounds
- 过程中绘图区边界public void dealOnZeroAxisGlyphLocation(double verticalZero)
verticalZero
- 它所垂直的坐标轴的0值得位置public void finallyUpdateAxisGridLength(double length)
public void drawAlertValueGlyph(java.awt.Graphics2D g2d, int resolution)
protected void drawIntervalBackground(java.awt.Graphics g)
public java.lang.Object getObjectFromFormula(BaseFormula formula)
protected java.awt.Shape getCustomBackgroundShape(double startValue, double endValue, boolean isCustom)
public java.awt.geom.Point2D getAlertValuePoint(java.lang.Object ob)
ob
- 该对象public java.awt.geom.Point2D getValuePoint(java.lang.Object ob)
ob
- 该对象public double getObjectValue(java.lang.Object ob)
protected void drawAfterPlot4AlertValues(java.awt.Graphics2D g2d, int resolution)
AxisGlyph
drawAfterPlot4AlertValues
在类中 AxisGlyph
protected boolean isRevertAndArrow()
isRevertAndArrow
在类中 AxisGlyph
protected java.awt.geom.Line2D getTickLine(double value, int tickLength, AxisTickLineType tickLineType)
value
- 刻度线所在值tickLength
- 刻度线长度tickLineType
- 刻度线类型protected java.awt.geom.Line2D getTickLineByCenterPoint(java.awt.geom.Point2D centerP, int tickLength, AxisTickLineType tickLineType)
protected double getTickLengthShow()
getTickLengthShow
在类中 AxisGlyph
protected void drawAxisLine(java.awt.Graphics g, int resolution)
drawAxisLine
在类中 AxisGlyph
protected double getMaxTickValue()
protected boolean shouldDrawTickLine(java.awt.geom.Line2D line)
shouldDrawTickLine
在类中 AxisGlyph
protected void drawAxisTitle(java.awt.Graphics g, int resolution)
drawAxisTitle
在类中 AxisGlyph
protected void drawLabel(java.awt.Graphics g, double value, double offset, java.lang.String labelString, int resolution)
protected void drawLabel(java.awt.Graphics g, double value, double offset, java.lang.String labelString, java.awt.geom.GeneralPath labelPath, int resolution)
protected void setMinMaxTickInterval(double min, double max, double tickInterval)
protected java.awt.geom.Rectangle2D calculatorTitleBounds(int resolution)
AxisGlyph
calculatorTitleBounds
在类中 AxisGlyph
protected void calculateValueTimeNiceDomain(boolean fromZero, boolean adjustMinMax, double minValue, double maxValue)
protected void calculateTitleDimesion(int resolution)
calculateTitleDimesion
在类中 AxisGlyph
public JSONObject toJSONObject(Repository repo) throws JSONException
toJSONObject
在接口中 Glyph
toJSONObject
在类中 AxisGlyph
repo
- 请求JSONException
- 抛错protected void gridLineToJSON(JSONObject js) throws JSONException
JSONException
protected void addMinMaxValue(JSONObject js, Repository repo) throws JSONException
addMinMaxValue
在类中 AxisGlyph
JSONException
protected void addValueFormat(JSONObject js, Repository repo) throws JSONException
JSONException
protected void addAxisLabelJSON(JSONObject js, Repository repo) throws JSONException
addAxisLabelJSON
在类中 AxisGlyph
JSONException