package org.jofc.facade;
import net.sf.json.JSONString;
import org.jofc.attribute.ChartAttribute;
import org.jofc.attribute.Title;
import org.jofc.attribute.XAxis;
import org.jofc.attribute.XAxisLabel;
import org.jofc.attribute.XLegend;
import org.jofc.attribute.YAxis;
import org.jofc.attribute.YAxisLabel;
import org.jofc.attribute.YLegend;
import org.jofc.builder.JOFCBaseBuilder;
import org.jofc.itf.JOFCElement;
import org.jofc.itf.JOFCValue;
import org.jofc.util.JOFCUtils;
import java.util.ArrayList;
import java.util.List;
public abstract class JChart implements JSONString {
private int gridNum = 10;
private boolean autoFitYaxis = true;
// int chartNum = 0;
/**
* 设置图表属性,这些属性是对整个图标的某种控制,比如背景颜色之类的
*
* @param ca
*/
public void setChartAttribute(ChartAttribute ca) {
getBuilder().setChartAttribute(ca);
}
/**
* 得到图标属性对象
*
* @return ChartAttribute
*/
public ChartAttribute getChartAttribute() {
return getBuilder().getChartAttribute();
}
/**
* 设置小数位数
*
* @param numDecimals
*/
public ChartAttribute setNumDecimals(int numDecimals) {
return getChartAttribute().setNumDecimals(numDecimals);
}
/**
* 是否强制显示指定位数的小数
*
* @return boolean
*/
public boolean isFixedNumDecimalsForced() {
return getChartAttribute().isFixedNumDecimalsForced();
}
/**
* 设置是否强制显示指定位数的小数
*
* @param isFixedNumDecimalsForced
*/
public ChartAttribute setIsFixedNumDecimalsForced(boolean isFixedNumDecimalsForced) {
return getChartAttribute().setIsFixedNumDecimalsForced(isFixedNumDecimalsForced);
}
/**
* 是否使用逗号作为分隔
*
* @return boolean
*/
public boolean isDecimalSeparatorComma() {
return getChartAttribute().isDecimalSeparatorComma();
}
/**
* 设置是否使用逗号作为分隔
*
* @param isDecimalSeparatorComma
* @return ChartAttribute
*/
public ChartAttribute setIsDecimalSeparatorComma(boolean isDecimalSeparatorComma) {
return getChartAttribute().setIsDecimalSeparatorComma(isDecimalSeparatorComma);
}
/**
* 是否使用千位的分割
*
* @return boolean
*/
public boolean isThousandSeparatorDisabled() {
return getChartAttribute().isThousandSeparatorDisabled();
}
/**
* 设置是否使用千位的分割
*
* @param isThousandSeparatorDisabled
* @return ChartAttribute
*/
public ChartAttribute setIsThousandSeparatorDisabled(boolean isThousandSeparatorDisabled) {
return getChartAttribute().setIsThousandSeparatorDisabled(isThousandSeparatorDisabled);
}
/**
* 背景颜色
*
* @return String
*/
public String getBgColour() {
return getChartAttribute().getBgColour();
}
/**
* 设置背景颜色
*
* @param colour
* @return ChartAttribute
*/
public ChartAttribute setBgColour(String colour) {
return getChartAttribute().setBgColour(colour);
}
/**
* 设置图表的标题,显示于图表上方
*
* @param title
*/
public void setTitle(String title) {
getBuilder().setTitle(title);
}
/**
* 设置图表的标题,显示于图表上方
*
* @param title
*/
public void setTitle(Title title) {
getBuilder().setTitle(title);
}
/**
* 设置X轴对象,包含了各种属性和样式设置
*
* @param xAxis
*/
public void setxAxis(XAxis xAxis) {
getBuilder().setxAxis(xAxis);
}
/**
* 返回显示X轴的坐标值时,间隔的单位数量
*
* @return int
*/
public int getXaxisLabelSteps() {
return getxAxis().getLabelSteps();
}
/**
* 显示X轴坐标值时,每steps个单位显示一个坐标值,如果为1,表示每个坐标值都显示
*
* @param labelSteps
*/
public void setXaxisLabelSteps(int labelSteps) {
getxAxis().setLabelSteps(labelSteps);
}
/**
* 返回X轴文字逆时针旋转的角度
*
* @return int
*/
public int getXaxisLabelRotate() {
return getxAxis().getLabelRotate();
}
/**
* 设置X轴文字逆时针旋转的角度
*
* @param labelRotate
*/
public void setXaxisLabelRotate(int labelRotate) {
getxAxis().setLabelRotate(labelRotate);
}
/**
* 返回X轴文字的颜色
*
* @return String
*/
public String getXaxisLabelColour() {
return getxAxis().getLabelColour();
}
/**
* 设置X轴文字的颜色
*
* @param labelColour
*/
public void setXaxisLabelColour(String labelColour) {
getxAxis().setLabelColour(labelColour);
}
/**
* 返回X轴文字的字号
*
* @return int
*/
public int getXaxisLabelSize() {
return getxAxis().getLabelSize();
}
/**
* 设置X轴文字的字号
*
* @param labelSize
*/
public void setXaxisLabelSize(int labelSize) {
getxAxis().setLabelSize(labelSize);
}
/**
* 返回X轴文字的对象列表,合法的对象类型包括String对象或者{@link XAxisLabel}对象
*
* @return List
*/
public List<Object> getXaxisLabelObjectList() {
return getxAxis().getLabelObjectList();
}
/**
* 返回X轴文字的字符串列表
*
* @return List
*/
public List<String> getXaxisLabelList() {
List<String> result = new ArrayList<String>();
List<Object> labels = getXaxisLabelObjectList();
for (Object label : labels) {
if (label == null) {
result.add("null");
} else if (label instanceof String) {
result.add((String) label);
} else if (label instanceof XAxisLabel) {
result.add(((XAxisLabel) label).getText());
} else {
result.add("undefined");
}
}
return result;
}
/**
* 设置X坐标轴的标签的值,List中可以放置String类型或者{@link XAxisLabel} 对象,其他类型按照"undefined"字符串处理
*
* @param labelList X坐标轴的标签值
* @see XAxisLabel
*/
public void setXaxisLabelList(List<Object> labelList) {
getxAxis().setLabelList(labelList);
}
/**
* 设置X坐标轴的标签的值,List中可以放置String类型或者{@link XAxisLabel} 对象,其他类型按照"undefined"字符串处理
*
* @param labelList X坐标轴的标签值
* @see XAxisLabel
*/
public void setXaxisLabelList(Object... labelList) {
getxAxis().setLabelList(labelList);
}
/**
* 设置X坐标轴的标签的值,List中可以放置String类型或者{@link XAxisLabel} 对象,其他类型按照"undefined"字符串处理
*
* @param labelList X坐标轴的标签值
* @see XAxisLabel
*/
public void setXaxisLabelList(String... labelList) {
getxAxis().setLabelList(labelList);
}
/**
* 返回X坐标轴上突出来的刻度的长度,单位是像素
*
* @return int
*/
public int getXaxisTickHeight() {
return getxAxis().getTickHeight();
}
/**
* 设置X坐标轴上突出来的刻度的长度,单位是像素
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
AJOFC -- stands for "Another Java API for Open Flash Chart 2" 这是OFC2的Java语言库,使用很简单;想必用过OFC的朋友都知道JOFC或者OFCJ吧!它们是使用OFC常用的Java语言库,我用的也是JOFC2,但JOFC2对OFC2的支持不足,比如柱形图样式只有三种,但其实OFC2支持的柱形图样式非常丰富,所以如果我们有需要不得不去扩展它。 本资源是中国人自己写的一个lib for OFC2,对OFC2的支持较为丰富。 Google Code:http://code.google.com/p/ajofc/ 但作者没有提供javadoc以示例什么的,本资源含有jar包、javadoc及源码。 作者最后有注:目前完成的是折线图,饼状图和柱状图,其他图形的接口还没有完成,敬请期待 复杂的图形作者还没有完成,也不知道还能不能完成,请大家慎重使用...
资源推荐
资源详情
资源评论
收起资源包目录
AJOFC -- Another Java API for Open Flash Chart 2 (294个子文件)
stylesheet.css 1KB
inherit.gif 57B
index-15.html 130KB
JChart.html 85KB
index-7.html 80KB
JLineChart.html 72KB
JBarChart.html 58KB
LineBuilder.html 47KB
LineElement.html 46KB
JPieChart.html 43KB
ChartTableDirector.html 39KB
ChartTable.html 36KB
BarBuilder.html 36KB
XAxis.html 33KB
JOFCBaseBuilder.html 32KB
PieElement.html 30KB
index-16.html 29KB
index-1.html 29KB
YAxis.html 28KB
BarElement.html 27KB
HorizontalBarChart.html 26KB
LineChart.html 26KB
BarChart.html 26KB
StackedBarChart.html 26KB
ScatterChart.html 26KB
PieBuilder.html 25KB
CandleChart.html 25KB
RadarChart.html 25KB
PieChart.html 25KB
AreaChart.html 25KB
LineValue.html 24KB
BarValue.html 24KB
JOFCValue.html 23KB
JOFCBaseBuilder.html 23KB
ChartTable.html 22KB
overview-tree.html 22KB
PieValue.html 22KB
LineElement.html 21KB
JOFCElement.html 20KB
LineDotStyle.html 20KB
BarValue.html 19KB
package-use.html 19KB
BarType.html 18KB
ChartAttribute.html 18KB
PieValue.html 18KB
ChartAttribute.html 18KB
Chart.html 18KB
LineDotType.html 17KB
JOFCAttribute.html 17KB
LineValue.html 17KB
package-use.html 17KB
LineAnimates.html 17KB
Title.html 17KB
YLegend.html 17KB
JPieChart.html 17KB
BarAnimates.html 17KB
JOFCChart.html 16KB
package-use.html 16KB
XLegend.html 16KB
XAxisLabel.html 16KB
YAxisLabel.html 16KB
package-use.html 15KB
HorizontalBarBuilder.html 15KB
LineAnimates.html 15KB
ScatterBuilder.html 15KB
CandleBuilder.html 15KB
BarAnimates.html 15KB
LineValueType.html 15KB
RadarBuilder.html 15KB
StackedBarBuilder.html 15KB
PieAnimates.html 15KB
JOFCUtils.html 15KB
AreaBuilder.html 14KB
Chart.html 14KB
ChartTableItem.html 14KB
LineDotStyle.html 14KB
YAxixEnum.html 14KB
ORDER.html 14KB
JLineChart.html 14KB
OtherAttributes.html 14KB
JOFCChart.html 14KB
index-17.html 13KB
PieAnimate.html 13KB
HorizontalBarValue.html 13KB
PieElement.html 13KB
StackedBarValue.html 13KB
HorizontalBarElement.html 13KB
ScatterValue.html 13KB
BarElement.html 13KB
CandleValue.html 13KB
ScatterElement.html 13KB
CandleElement.html 13KB
RadarValue.html 13KB
RadarElement.html 13KB
AreaValue.html 13KB
StackedBarElement.html 13KB
PieAnimates.html 13KB
index-10.html 13KB
JOFCDataCache.html 13KB
index-9.html 12KB
共 294 条
- 1
- 2
- 3
玄月初心
- 粉丝: 218
- 资源: 31
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页