fusionchartsv3实体类封装
单系图(pie2D,Column2D,Line)
只有头和数据部分 head,data
public class ColumnHead {
private String caption;// 标题
private String subCaption;// 子标题
private String palette;// 1-5(5种默认的调色板风格任你选)
private String xAxisName;// x轴名称
private String yAxisName;// y名称
private String showValues;// 在图中是否显示数值
private String useRoundEdges;// '0/1'(是否显示光滑边缘)
private String bgColor;// 图表背景颜色
private String numberPrefix;// 数值前缀
private String numberSuffix;// 数值后缀
private String decimals;// '0-10'(小数点后保留几位)
private String baseFont;// 字体
private String baseFontSize;// '0-72'(字体大小)
private String baseFontColor;// 字体颜色(十六进制)
private String showBorder;// 显示边框(0/1)
private String yAxisMaxValue;//设置y轴的最大值
private String yAxisMinValue;//设置y轴的最小值
private String showShadow;//是否显示阴影(0/1)
private String imageSave;//是否保存图片 1是 0否
private String imageSaveURL;//保存图片的地址
private String formatNumberScale;//是否格式化数字 是否格式化数字,默认为1(True),自动的给你的数字加上K(千)或M(百万);若取0,则不加K或M
/****折线****/
private String anchorRadius;//折线锚点圆的半径数字
private String lineThickness;//折线的厚度
private String anchorBgAlpha;//折线节点透明度,[0-100]
private String anchorBgColor;//折线节点填充颜色,6位16进制颜色值
private String anchorBorderColor;//折线节点边框颜色,6位16进制颜色值
private String lineColor;//折线颜色,6位16进制颜色值
private String divLineColor;//分割线的颜色,6位16进制颜色值
private String canvasBorderColor;//画布边框颜色,6位16进制颜色值
private String divLineAlpha;//分割线的滤镜效果(0-100)
/*****波浪图******/
private String showAlternateVGridColor;//是否在纵向网格带交替的颜色,默认为0(False)
private String alternateVGridColor;//纵向网格带交替的颜色,6位16进制颜色值
private String alternateVGridAlpha;// 纵向网格带的透明度,[0-100]
/**导出图片*/
private String exportFormats;
private String exportAction;
private String exportHandler;
public ColumnHead() {//构造默认属性
super();
this.showValues = "1";//在图中列表显示统计数值
this.formatNumberScale = "0";//统计数值 非格式化
this.useRoundEdges = "1";//显示光滑边缘
this.imageSave = "1";//保存图片
/**导出功能初始化 start*/
this.exportFormats="JPEG=导出为JPG图片";
this.exportAction="download";
this.exportHandler="ExportExample/FCExporter";
/**导出功能初始化 end*/
}
public String getDivLineAlpha() {
return divLineAlpha;
}
public void setDivLineAlpha(String divLineAlpha) {
this.divLineAlpha = divLineAlpha;
}
public String getCanvasBorderColor() {
return canvasBorderColor;
}
public void setCanvasBorderColor(String canvasBorderColor) {
this.canvasBorderColor = canvasBorderColor;
}
public String getLineColor() {
return lineColor;
}
public void setLineColor(String lineColor) {
this.lineColor = lineColor;
}
public String getDivLineColor() {
return divLineColor;
}
public void setDivLineColor(String divLineColor) {
this.divLineColor = divLineColor;
}
public String getyAxisMaxValue() {
return yAxisMaxValue;
}
public void setyAxisMaxValue(String yAxisMaxValue) {
this.yAxisMaxValue = yAxisMaxValue;
}
public String getyAxisMinValue() {
return yAxisMinValue;
}
public void setyAxisMinValue(String yAxisMinValue) {
this.yAxisMinValue = yAxisMinValue;
}
public String getShowShadow() {
return showShadow;
}
public void setShowShadow(String showShadow) {
this.showShadow = showShadow;
}
public String getShowAlternateVGridColor() {
return showAlternateVGridColor;
}
public void setShowAlternateVGridColor(String showAlternateVGridColor) {
this.showAlternateVGridColor = showAlternateVGridColor;
}
public String getAlternateVGridColor() {
return alternateVGridColor;
}
public void setAlternateVGridColor(String alternateVGridColor) {
this.alternateVGridColor = alternateVGridColor;
}
public String getAlternateVGridAlpha() {
return alternateVGridAlpha;
}
public void setAlternateVGridAlpha(String alternateVGridAlpha) {
this.alternateVGridAlpha = alternateVGridAlpha;
}
public String getLineThickness() {
return lineThickness;
}
public void setLineThickness(String lineThickness) {
this.lineThickness = lineThickness;
}
public String getAnchorBgAlpha() {
return anchorBgAlpha;
}
public void setAnchorBgAlpha(String anchorBgAlpha) {
this.anchorBgAlpha = anchorBgAlpha;
}
public String getAnchorBgColor() {
return anchorBgColor;
}
public void setAnchorBgColor(String anchorBgColor) {
this.anchorBgColor = anchorBgColor;
}
public String getAnchorBorderColor() {
return anchorBorderColor;
}
public void setAnchorBorderColor(String anchorBorderColor) {
this.anchorBorderColor = anchorBorderColor;
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption;
}
public String getSubCaption() {
return subCaption;
}
public void setSubCaption(String subCaption) {
this.subCaption = subCaption;
}
public String getPalette() {
return palette;
}
public void setPalette(String palette) {
this.palette = palette;
}
public String getxAxisName() {
return xAxisName;
}
public void setxAxisName(String xAxisName) {
this.xAxisName = xAxisName;
}
public String getyAxisName() {
return yAxisName;
}
public void setyAxisName(String yAxisName) {
this.yAxisName = yAxisName;
}
public String getShowValues() {
return showValues;
}
public void setShowValues(String showValues) {
this.showValues = showValues;
}
public String getUseRoundEdges() {
return useRoundEdges;
}
public void setUseRoundEdges(String useRoundEdges) {
this.useRoundEdges = useRoundEdges;
}
public String getBgColor() {
return bgColor;
}
public void setBgColor(String bgColor) {
this.bgColor = bgColor;
}
public String getNumberPrefix() {
return numberPrefix;
}
public void setNumberPrefix(String numberPrefix) {
this.numberPrefix = numberPrefix;
}
public String getNumberSuffix() {
return numberSuffix;
}
public void setNumberSuffix(String numberSuffix) {
this.numberSuffix = numberSuffix;
}
public String getDecimals() {
return decimals;
}
public void setDecimals(String decimals) {
this.decimals = decimals;
}
public String getBaseFont() {
return baseFont;
}
public void setBaseFont(String baseFont) {
this.baseFont = baseFont;
}
public String getBaseFontSize() {
return baseFontSize;
}
public void setBaseFontSize(String baseFontSize) {
this.baseFontSize = baseFontSize;
}
public String getBaseFontColor() {
return baseFontColor;
}
public void setBaseFontColor(String baseFontColor) {
this.baseFontColor = baseFontColor;
}
public String getShowBorder() {
return showBorder;
}
public void setShowBorder(String showBorder) {
this.showBorder = showBorder;
}
public String getAnchorRadius() {
return anchorRadius;
}
public void setAnchorRadius(String anchorRadius) {
this.anchorRadius = anchorRadius;
}
public String getImageSave() {
return imageSave;
}
public void setImageSave(String imageSave) {
this.imageSave = imageSave;
}
public String getFormatNumberScale() {
return formatNumberScale;
}
public void setFormatNumberScale(String formatNumberScale) {
this.formatNumberScale = formatNumberScale;
}
public String getImageSaveURL() {
return imageSaveURL;
}
public void setImageSaveURL(String imageSaveURL) {
this.imageSaveURL = imageSaveURL;
}
public String getExportFormats() {
return exportFormats;
}
public void setExportFormats(String exportFormats) {
this.exportFormats = exportFormats;
}
public String getExportAction() {
return exportAction;
}
public void setExportAction(String exportAction) {
this.exportAction = exportAction;
}
public String getExportHandler() {
return exportHandler;
}
public void setExportHandler(String exportHandler) {
this.exportHandler = exportHandler;
}
}
public class SetData {
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
public class SingleChart {
private ColumnHead chart;
private List<SingleData> data;
public ColumnHead getChart() {
return chart;
}
public void setChart(ColumnHead chart) {
this.chart = chart;
}
public List<SingleData> getData() {
return data;
}
public void setData(List<SingleData> data) {
this.data = data;
}
public static void main(String[] args) {
ColumnHead head=new ColumnHead();
head.setCaption("在库统计");
head.setNumberPrefix("$");
head.setShowValues("1");
head.setxAxisName("数量");
head.setyAxisName("仓库");
SingleChart chart=new SingleChart();
chart.setChart(head);
List<SingleData> list=new ArrayList<SingleData>();
for (int i = 0; i <10; i++) {
SingleData data=new SingleData();
data.setLabel("仓库1"+i+"");
data.setValue("data"+i+"");
list.add(data);
}
chart.setData(list);
System.out.println(JsonUtil.getJsonStringFromObject(chart));
}
}