jacky6024
7 anos atrás
36 arquivos alterados com 1679 adições e 4 exclusões
@ -0,0 +1,48 @@ |
|||
/******************************************************************************* |
|||
* Copyright 2017 Bstek |
|||
* |
|||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
|||
* use this file except in compliance with the License. You may obtain a copy |
|||
* of the License at |
|||
* |
|||
* http://www.apache.org/licenses/LICENSE-2.0
|
|||
* |
|||
* Unless required by applicable law or agreed to in writing, software |
|||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
|||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
|||
* License for the specific language governing permissions and limitations under |
|||
* the License. |
|||
******************************************************************************/ |
|||
package com.bstek.ureport.build.compute; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
import com.bstek.ureport.build.BindData; |
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.Chart; |
|||
import com.bstek.ureport.definition.value.ChartValue; |
|||
import com.bstek.ureport.definition.value.ValueType; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月9日 |
|||
*/ |
|||
public class ChartValueCompute implements ValueCompute { |
|||
|
|||
@Override |
|||
public List<BindData> compute(Cell cell, Context context) { |
|||
ChartValue chartValue=(ChartValue)cell.getValue(); |
|||
Chart chart=chartValue.getChart(); |
|||
String data=chart.doCompute(cell, context); |
|||
List<BindData> list=new ArrayList<BindData>(); |
|||
list.add(new BindData(data)); |
|||
return list; |
|||
} |
|||
|
|||
@Override |
|||
public ValueType type() { |
|||
return ValueType.chart; |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.bstek.ureport.chart; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.Dataset; |
|||
import com.bstek.ureport.chart.option.Option; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class Chart { |
|||
private Option option; |
|||
private Dataset dataset; |
|||
public String doCompute(Cell cell, Context context){ |
|||
StringBuilder sb=new StringBuilder(); |
|||
|
|||
return sb.toString(); |
|||
} |
|||
public Option getOption() { |
|||
return option; |
|||
} |
|||
public void setOption(Option option) { |
|||
this.option = option; |
|||
} |
|||
public Dataset getDataset() { |
|||
return dataset; |
|||
} |
|||
public void setDataset(Dataset dataset) { |
|||
this.dataset = dataset; |
|||
} |
|||
} |
@ -0,0 +1,10 @@ |
|||
package com.bstek.ureport.chart.dataset; |
|||
|
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月9日 |
|||
*/ |
|||
public abstract class BaseDataset implements Dataset { |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.bstek.ureport.chart.dataset; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class BubbleData { |
|||
private int x; |
|||
private int y; |
|||
private int r; |
|||
public int getX() { |
|||
return x; |
|||
} |
|||
public void setX(int x) { |
|||
this.x = x; |
|||
} |
|||
public int getY() { |
|||
return y; |
|||
} |
|||
public void setY(int y) { |
|||
this.y = y; |
|||
} |
|||
public int getR() { |
|||
return r; |
|||
} |
|||
public void setR(int r) { |
|||
this.r = r; |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.bstek.ureport.chart.dataset; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public interface Dataset { |
|||
String buildConfiguration(Context context,Cell cell); |
|||
DatasetType getDatasetType(); |
|||
String type(); |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.bstek.ureport.chart.dataset; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public enum DatasetType { |
|||
Line,Bar,HorizontalBar,Radar,Pie,Polar,Bubble,Scatter,Area,Mix |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.bstek.ureport.chart.dataset; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public enum PointStyle { |
|||
circle,cross,crossRot,dash,rect,rectRounded,rectRot,star,triangle |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.bstek.ureport.chart.dataset; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class ScatterData { |
|||
private int x; |
|||
private int y; |
|||
public int getX() { |
|||
return x; |
|||
} |
|||
public void setX(int x) { |
|||
this.x = x; |
|||
} |
|||
public int getY() { |
|||
return y; |
|||
} |
|||
public void setY(int y) { |
|||
this.y = y; |
|||
} |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.bstek.ureport.chart.dataset; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月9日 |
|||
*/ |
|||
public enum Source { |
|||
dataset,expression; |
|||
} |
@ -0,0 +1,89 @@ |
|||
package com.bstek.ureport.chart.dataset.impl; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.BubbleData; |
|||
import com.bstek.ureport.chart.dataset.Dataset; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class BubbleDataset implements Dataset { |
|||
private BubbleData data; |
|||
private String label; |
|||
private String backgroundColor; |
|||
private String borderColor; |
|||
private int borderWidth; |
|||
private String hoverBackgroundColor; |
|||
private String hoverBorderColor; |
|||
private int hoverBorderWidth; |
|||
private int hoverRadius; |
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
return null; |
|||
} |
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.Bubble; |
|||
} |
|||
@Override |
|||
public String type() { |
|||
return "bubble"; |
|||
} |
|||
public BubbleData getData() { |
|||
return data; |
|||
} |
|||
public void setData(BubbleData data) { |
|||
this.data = data; |
|||
} |
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
public void setLabel(String label) { |
|||
this.label = label; |
|||
} |
|||
public String getBackgroundColor() { |
|||
return backgroundColor; |
|||
} |
|||
public void setBackgroundColor(String backgroundColor) { |
|||
this.backgroundColor = backgroundColor; |
|||
} |
|||
public String getBorderColor() { |
|||
return borderColor; |
|||
} |
|||
public void setBorderColor(String borderColor) { |
|||
this.borderColor = borderColor; |
|||
} |
|||
public int getBorderWidth() { |
|||
return borderWidth; |
|||
} |
|||
public void setBorderWidth(int borderWidth) { |
|||
this.borderWidth = borderWidth; |
|||
} |
|||
public String getHoverBackgroundColor() { |
|||
return hoverBackgroundColor; |
|||
} |
|||
public void setHoverBackgroundColor(String hoverBackgroundColor) { |
|||
this.hoverBackgroundColor = hoverBackgroundColor; |
|||
} |
|||
public String getHoverBorderColor() { |
|||
return hoverBorderColor; |
|||
} |
|||
public void setHoverBorderColor(String hoverBorderColor) { |
|||
this.hoverBorderColor = hoverBorderColor; |
|||
} |
|||
public int getHoverBorderWidth() { |
|||
return hoverBorderWidth; |
|||
} |
|||
public void setHoverBorderWidth(int hoverBorderWidth) { |
|||
this.hoverBorderWidth = hoverBorderWidth; |
|||
} |
|||
public int getHoverRadius() { |
|||
return hoverRadius; |
|||
} |
|||
public void setHoverRadius(int hoverRadius) { |
|||
this.hoverRadius = hoverRadius; |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.bstek.ureport.chart.dataset.impl; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月9日 |
|||
*/ |
|||
public class DoughnutDataset extends PieDataset { |
|||
@Override |
|||
public String type() { |
|||
return "doughnut"; |
|||
} |
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.bstek.ureport.chart.dataset.impl; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.Dataset; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.chart.dataset.impl.category.BarDataset; |
|||
import com.bstek.ureport.chart.dataset.impl.category.LineDataset; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class MixDataset implements Dataset { |
|||
private List<BarDataset> barDatasets=new ArrayList<BarDataset>(); |
|||
private List<LineDataset> lineDatasets=new ArrayList<LineDataset>(); |
|||
|
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.Mix; |
|||
} |
|||
|
|||
@Override |
|||
public String type() { |
|||
return "bar"; |
|||
} |
|||
|
|||
public List<BarDataset> getBarDatasets() { |
|||
return barDatasets; |
|||
} |
|||
|
|||
public void setBarDatasets(List<BarDataset> barDatasets) { |
|||
this.barDatasets = barDatasets; |
|||
} |
|||
|
|||
public List<LineDataset> getLineDatasets() { |
|||
return lineDatasets; |
|||
} |
|||
|
|||
public void setLineDatasets(List<LineDataset> lineDatasets) { |
|||
this.lineDatasets = lineDatasets; |
|||
} |
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.bstek.ureport.chart.dataset.impl; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.Dataset; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class PieDataset implements Dataset { |
|||
private double[] data; |
|||
private String label; |
|||
private String backgroundColor; |
|||
private String borderColor; |
|||
private int borderWidth; |
|||
private String hoverBackgroundColor; |
|||
private String hoverBorderColor; |
|||
private int hoverBorderWidth; |
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.Pie; |
|||
} |
|||
|
|||
@Override |
|||
public String type() { |
|||
return "pie"; |
|||
} |
|||
|
|||
public double[] getData() { |
|||
return data; |
|||
} |
|||
|
|||
public void setData(double[] data) { |
|||
this.data = data; |
|||
} |
|||
|
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
|
|||
public void setLabel(String label) { |
|||
this.label = label; |
|||
} |
|||
|
|||
public String getBackgroundColor() { |
|||
return backgroundColor; |
|||
} |
|||
|
|||
public void setBackgroundColor(String backgroundColor) { |
|||
this.backgroundColor = backgroundColor; |
|||
} |
|||
|
|||
public String getBorderColor() { |
|||
return borderColor; |
|||
} |
|||
|
|||
public void setBorderColor(String borderColor) { |
|||
this.borderColor = borderColor; |
|||
} |
|||
|
|||
public int getBorderWidth() { |
|||
return borderWidth; |
|||
} |
|||
|
|||
public void setBorderWidth(int borderWidth) { |
|||
this.borderWidth = borderWidth; |
|||
} |
|||
|
|||
public String getHoverBackgroundColor() { |
|||
return hoverBackgroundColor; |
|||
} |
|||
|
|||
public void setHoverBackgroundColor(String hoverBackgroundColor) { |
|||
this.hoverBackgroundColor = hoverBackgroundColor; |
|||
} |
|||
|
|||
public String getHoverBorderColor() { |
|||
return hoverBorderColor; |
|||
} |
|||
|
|||
public void setHoverBorderColor(String hoverBorderColor) { |
|||
this.hoverBorderColor = hoverBorderColor; |
|||
} |
|||
|
|||
public int getHoverBorderWidth() { |
|||
return hoverBorderWidth; |
|||
} |
|||
|
|||
public void setHoverBorderWidth(int hoverBorderWidth) { |
|||
this.hoverBorderWidth = hoverBorderWidth; |
|||
} |
|||
} |
@ -0,0 +1,99 @@ |
|||
package com.bstek.ureport.chart.dataset.impl; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.Dataset; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class PolarDataset implements Dataset { |
|||
private double[] data; |
|||
private String label; |
|||
private String backgroundColor; |
|||
private String borderColor; |
|||
private int borderWidth; |
|||
private String hoverBackgroundColor; |
|||
private String hoverBorderColor; |
|||
private int hoverBorderWidth; |
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.Polar; |
|||
} |
|||
|
|||
@Override |
|||
public String type() { |
|||
return "polarArea"; |
|||
} |
|||
|
|||
public double[] getData() { |
|||
return data; |
|||
} |
|||
|
|||
public void setData(double[] data) { |
|||
this.data = data; |
|||
} |
|||
|
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
|
|||
public void setLabel(String label) { |
|||
this.label = label; |
|||
} |
|||
|
|||
public String getBackgroundColor() { |
|||
return backgroundColor; |
|||
} |
|||
|
|||
public void setBackgroundColor(String backgroundColor) { |
|||
this.backgroundColor = backgroundColor; |
|||
} |
|||
|
|||
public String getBorderColor() { |
|||
return borderColor; |
|||
} |
|||
|
|||
public void setBorderColor(String borderColor) { |
|||
this.borderColor = borderColor; |
|||
} |
|||
|
|||
public int getBorderWidth() { |
|||
return borderWidth; |
|||
} |
|||
|
|||
public void setBorderWidth(int borderWidth) { |
|||
this.borderWidth = borderWidth; |
|||
} |
|||
|
|||
public String getHoverBackgroundColor() { |
|||
return hoverBackgroundColor; |
|||
} |
|||
|
|||
public void setHoverBackgroundColor(String hoverBackgroundColor) { |
|||
this.hoverBackgroundColor = hoverBackgroundColor; |
|||
} |
|||
|
|||
public String getHoverBorderColor() { |
|||
return hoverBorderColor; |
|||
} |
|||
|
|||
public void setHoverBorderColor(String hoverBorderColor) { |
|||
this.hoverBorderColor = hoverBorderColor; |
|||
} |
|||
|
|||
public int getHoverBorderWidth() { |
|||
return hoverBorderWidth; |
|||
} |
|||
|
|||
public void setHoverBorderWidth(int hoverBorderWidth) { |
|||
this.hoverBorderWidth = hoverBorderWidth; |
|||
} |
|||
} |
@ -0,0 +1,182 @@ |
|||
package com.bstek.ureport.chart.dataset.impl; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.Dataset; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.chart.dataset.PointStyle; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class RadarDataset implements Dataset { |
|||
private double[] data; |
|||
private String label; |
|||
private String backgroundColor; |
|||
private String borderColor; |
|||
private int borderWidth; |
|||
private boolean fill; |
|||
private double lineTension=0.1; |
|||
private String pointBackgroundColor; |
|||
private String pointBorderColor; |
|||
private int pointBorderWidth; |
|||
private int pointRadius; |
|||
private PointStyle pointStyle; |
|||
private int pointHitRadius; |
|||
private String pointHoverBackgroundColor; |
|||
private String pointHoverBorderColor; |
|||
private int pointHoverBorderWidth; |
|||
private int pointHoverRadius; |
|||
|
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.Radar; |
|||
} |
|||
|
|||
@Override |
|||
public String type() { |
|||
return "radar"; |
|||
} |
|||
|
|||
public double[] getData() { |
|||
return data; |
|||
} |
|||
|
|||
public void setData(double[] data) { |
|||
this.data = data; |
|||
} |
|||
|
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
|
|||
public void setLabel(String label) { |
|||
this.label = label; |
|||
} |
|||
|
|||
public String getBackgroundColor() { |
|||
return backgroundColor; |
|||
} |
|||
|
|||
public void setBackgroundColor(String backgroundColor) { |
|||
this.backgroundColor = backgroundColor; |
|||
} |
|||
|
|||
public String getBorderColor() { |
|||
return borderColor; |
|||
} |
|||
|
|||
public void setBorderColor(String borderColor) { |
|||
this.borderColor = borderColor; |
|||
} |
|||
|
|||
public int getBorderWidth() { |
|||
return borderWidth; |
|||
} |
|||
|
|||
public void setBorderWidth(int borderWidth) { |
|||
this.borderWidth = borderWidth; |
|||
} |
|||
|
|||
public boolean isFill() { |
|||
return fill; |
|||
} |
|||
|
|||
public void setFill(boolean fill) { |
|||
this.fill = fill; |
|||
} |
|||
|
|||
public double getLineTension() { |
|||
return lineTension; |
|||
} |
|||
|
|||
public void setLineTension(double lineTension) { |
|||
this.lineTension = lineTension; |
|||
} |
|||
|
|||
public String getPointBackgroundColor() { |
|||
return pointBackgroundColor; |
|||
} |
|||
|
|||
public void setPointBackgroundColor(String pointBackgroundColor) { |
|||
this.pointBackgroundColor = pointBackgroundColor; |
|||
} |
|||
|
|||
public String getPointBorderColor() { |
|||
return pointBorderColor; |
|||
} |
|||
|
|||
public void setPointBorderColor(String pointBorderColor) { |
|||
this.pointBorderColor = pointBorderColor; |
|||
} |
|||
|
|||
public int getPointBorderWidth() { |
|||
return pointBorderWidth; |
|||
} |
|||
|
|||
public void setPointBorderWidth(int pointBorderWidth) { |
|||
this.pointBorderWidth = pointBorderWidth; |
|||
} |
|||
|
|||
public int getPointRadius() { |
|||
return pointRadius; |
|||
} |
|||
|
|||
public void setPointRadius(int pointRadius) { |
|||
this.pointRadius = pointRadius; |
|||
} |
|||
|
|||
public PointStyle getPointStyle() { |
|||
return pointStyle; |
|||
} |
|||
|
|||
public void setPointStyle(PointStyle pointStyle) { |
|||
this.pointStyle = pointStyle; |
|||
} |
|||
|
|||
public int getPointHitRadius() { |
|||
return pointHitRadius; |
|||
} |
|||
|
|||
public void setPointHitRadius(int pointHitRadius) { |
|||
this.pointHitRadius = pointHitRadius; |
|||
} |
|||
|
|||
public String getPointHoverBackgroundColor() { |
|||
return pointHoverBackgroundColor; |
|||
} |
|||
|
|||
public void setPointHoverBackgroundColor(String pointHoverBackgroundColor) { |
|||
this.pointHoverBackgroundColor = pointHoverBackgroundColor; |
|||
} |
|||
|
|||
public String getPointHoverBorderColor() { |
|||
return pointHoverBorderColor; |
|||
} |
|||
|
|||
public void setPointHoverBorderColor(String pointHoverBorderColor) { |
|||
this.pointHoverBorderColor = pointHoverBorderColor; |
|||
} |
|||
|
|||
public int getPointHoverBorderWidth() { |
|||
return pointHoverBorderWidth; |
|||
} |
|||
|
|||
public void setPointHoverBorderWidth(int pointHoverBorderWidth) { |
|||
this.pointHoverBorderWidth = pointHoverBorderWidth; |
|||
} |
|||
|
|||
public int getPointHoverRadius() { |
|||
return pointHoverRadius; |
|||
} |
|||
|
|||
public void setPointHoverRadius(int pointHoverRadius) { |
|||
this.pointHoverRadius = pointHoverRadius; |
|||
} |
|||
} |
@ -0,0 +1,146 @@ |
|||
package com.bstek.ureport.chart.dataset.impl; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.Dataset; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.chart.dataset.PointStyle; |
|||
import com.bstek.ureport.chart.dataset.ScatterData; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class ScatterDataset implements Dataset { |
|||
private ScatterData data; |
|||
private String label; |
|||
private String backgroundColor; |
|||
private String borderColor; |
|||
private int borderWidth; |
|||
private boolean fill; |
|||
private double lineTension=0.2; |
|||
private String pointBackgroundColor; |
|||
private String pointBorderColor; |
|||
private int pointBorderWidth; |
|||
private int pointRadius; |
|||
private PointStyle pointStyle; |
|||
private int pointHitRadius; |
|||
private String pointHoverBackgroundColor; |
|||
private String pointHoverBorderColor; |
|||
private int pointHoverBorderWidth; |
|||
private int pointHoverRadius; |
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
return null; |
|||
} |
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.Scatter; |
|||
} |
|||
@Override |
|||
public String type() { |
|||
return "scatter"; |
|||
} |
|||
public ScatterData getData() { |
|||
return data; |
|||
} |
|||
public void setData(ScatterData data) { |
|||
this.data = data; |
|||
} |
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
public void setLabel(String label) { |
|||
this.label = label; |
|||
} |
|||
public String getBackgroundColor() { |
|||
return backgroundColor; |
|||
} |
|||
public void setBackgroundColor(String backgroundColor) { |
|||
this.backgroundColor = backgroundColor; |
|||
} |
|||
public String getBorderColor() { |
|||
return borderColor; |
|||
} |
|||
public void setBorderColor(String borderColor) { |
|||
this.borderColor = borderColor; |
|||
} |
|||
public int getBorderWidth() { |
|||
return borderWidth; |
|||
} |
|||
public void setBorderWidth(int borderWidth) { |
|||
this.borderWidth = borderWidth; |
|||
} |
|||
public boolean isFill() { |
|||
return fill; |
|||
} |
|||
public void setFill(boolean fill) { |
|||
this.fill = fill; |
|||
} |
|||
public double getLineTension() { |
|||
return lineTension; |
|||
} |
|||
public void setLineTension(double lineTension) { |
|||
this.lineTension = lineTension; |
|||
} |
|||
public String getPointBackgroundColor() { |
|||
return pointBackgroundColor; |
|||
} |
|||
public void setPointBackgroundColor(String pointBackgroundColor) { |
|||
this.pointBackgroundColor = pointBackgroundColor; |
|||
} |
|||
public String getPointBorderColor() { |
|||
return pointBorderColor; |
|||
} |
|||
public void setPointBorderColor(String pointBorderColor) { |
|||
this.pointBorderColor = pointBorderColor; |
|||
} |
|||
public int getPointBorderWidth() { |
|||
return pointBorderWidth; |
|||
} |
|||
public void setPointBorderWidth(int pointBorderWidth) { |
|||
this.pointBorderWidth = pointBorderWidth; |
|||
} |
|||
public int getPointRadius() { |
|||
return pointRadius; |
|||
} |
|||
public void setPointRadius(int pointRadius) { |
|||
this.pointRadius = pointRadius; |
|||
} |
|||
public PointStyle getPointStyle() { |
|||
return pointStyle; |
|||
} |
|||
public void setPointStyle(PointStyle pointStyle) { |
|||
this.pointStyle = pointStyle; |
|||
} |
|||
public int getPointHitRadius() { |
|||
return pointHitRadius; |
|||
} |
|||
public void setPointHitRadius(int pointHitRadius) { |
|||
this.pointHitRadius = pointHitRadius; |
|||
} |
|||
public String getPointHoverBackgroundColor() { |
|||
return pointHoverBackgroundColor; |
|||
} |
|||
public void setPointHoverBackgroundColor(String pointHoverBackgroundColor) { |
|||
this.pointHoverBackgroundColor = pointHoverBackgroundColor; |
|||
} |
|||
public String getPointHoverBorderColor() { |
|||
return pointHoverBorderColor; |
|||
} |
|||
public void setPointHoverBorderColor(String pointHoverBorderColor) { |
|||
this.pointHoverBorderColor = pointHoverBorderColor; |
|||
} |
|||
public int getPointHoverBorderWidth() { |
|||
return pointHoverBorderWidth; |
|||
} |
|||
public void setPointHoverBorderWidth(int pointHoverBorderWidth) { |
|||
this.pointHoverBorderWidth = pointHoverBorderWidth; |
|||
} |
|||
public int getPointHoverRadius() { |
|||
return pointHoverRadius; |
|||
} |
|||
public void setPointHoverRadius(int pointHoverRadius) { |
|||
this.pointHoverRadius = pointHoverRadius; |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.bstek.ureport.chart.dataset.impl.category; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class AreaDataset extends LineDataset { |
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
return null; |
|||
} |
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.Area; |
|||
} |
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.bstek.ureport.chart.dataset.impl.category; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.Dataset; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class BarDataset implements Dataset{ |
|||
private double[] data; |
|||
private String label; |
|||
private String backgroundColor; |
|||
private String borderColor; |
|||
private int borderWidth; |
|||
private String hoverBackgroundColor; |
|||
private String hoverBorderColor; |
|||
private String hoverBorderWidth; |
|||
|
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
return null; |
|||
} |
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.Bar; |
|||
} |
|||
@Override |
|||
public String type() { |
|||
return "bar"; |
|||
} |
|||
public double[] getData() { |
|||
return data; |
|||
} |
|||
public void setData(double[] data) { |
|||
this.data = data; |
|||
} |
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
public void setLabel(String label) { |
|||
this.label = label; |
|||
} |
|||
public String getBackgroundColor() { |
|||
return backgroundColor; |
|||
} |
|||
public void setBackgroundColor(String backgroundColor) { |
|||
this.backgroundColor = backgroundColor; |
|||
} |
|||
public String getBorderColor() { |
|||
return borderColor; |
|||
} |
|||
public void setBorderColor(String borderColor) { |
|||
this.borderColor = borderColor; |
|||
} |
|||
public int getBorderWidth() { |
|||
return borderWidth; |
|||
} |
|||
public void setBorderWidth(int borderWidth) { |
|||
this.borderWidth = borderWidth; |
|||
} |
|||
public String getHoverBackgroundColor() { |
|||
return hoverBackgroundColor; |
|||
} |
|||
public void setHoverBackgroundColor(String hoverBackgroundColor) { |
|||
this.hoverBackgroundColor = hoverBackgroundColor; |
|||
} |
|||
public String getHoverBorderColor() { |
|||
return hoverBorderColor; |
|||
} |
|||
public void setHoverBorderColor(String hoverBorderColor) { |
|||
this.hoverBorderColor = hoverBorderColor; |
|||
} |
|||
public String getHoverBorderWidth() { |
|||
return hoverBorderWidth; |
|||
} |
|||
public void setHoverBorderWidth(String hoverBorderWidth) { |
|||
this.hoverBorderWidth = hoverBorderWidth; |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.bstek.ureport.chart.dataset.impl.category; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月9日 |
|||
*/ |
|||
public class CategoryData { |
|||
private String label; |
|||
private List<Double> data; |
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
public void setLabel(String label) { |
|||
this.label = label; |
|||
} |
|||
public List<Double> getData() { |
|||
return data; |
|||
} |
|||
public void setData(List<Double> data) { |
|||
this.data = data; |
|||
} |
|||
} |
@ -0,0 +1,118 @@ |
|||
package com.bstek.ureport.chart.dataset.impl.category; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import com.bstek.ureport.Utils; |
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.BaseDataset; |
|||
import com.bstek.ureport.chart.dataset.Source; |
|||
import com.bstek.ureport.definition.value.AggregateType; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月9日 |
|||
*/ |
|||
public abstract class CategoryDataset extends BaseDataset { |
|||
private Source source=Source.dataset; |
|||
private AggregateType aggregateType=AggregateType.select; |
|||
|
|||
private String datasetName; |
|||
private String categoryProperty; |
|||
private String seriesProperty; |
|||
private String valueProperty; |
|||
|
|||
|
|||
private String categoryExpression; |
|||
private String seriesExpression; |
|||
private String valueExpression; |
|||
|
|||
protected List<CategoryData> buildCategoryDatas(Context context,Cell cell){ |
|||
List<CategoryData> list=new ArrayList<CategoryData>(); |
|||
List<?> data=context.getDatasetData(datasetName); |
|||
List<Object> categoryList=new ArrayList<Object>(); |
|||
Map<Object,List<Object>> seriesMap=new HashMap<Object,List<Object>>(); |
|||
for(Object obj:data){ |
|||
Object category=Utils.getProperty(obj, categoryProperty); |
|||
if(category!=null){ |
|||
if(!categoryList.contains(category)){ |
|||
categoryList.add(category); |
|||
} |
|||
} |
|||
Object series=Utils.getProperty(obj, seriesProperty); |
|||
if(series!=null){ |
|||
List<Object> valueList; |
|||
if(seriesMap.containsKey(series)){ |
|||
valueList=seriesMap.get(series); |
|||
}else{ |
|||
valueList=new ArrayList<Object>(); |
|||
seriesMap.put(series, valueList); |
|||
} |
|||
Object value=Utils.getProperty(obj, valueProperty); |
|||
valueList.add(value); |
|||
} |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
public AggregateType getAggregateType() { |
|||
return aggregateType; |
|||
} |
|||
|
|||
public void setAggregateType(AggregateType aggregateType) { |
|||
this.aggregateType = aggregateType; |
|||
} |
|||
|
|||
public Source getSource() { |
|||
return source; |
|||
} |
|||
public void setSource(Source source) { |
|||
this.source = source; |
|||
} |
|||
public String getDatasetName() { |
|||
return datasetName; |
|||
} |
|||
public void setDatasetName(String datasetName) { |
|||
this.datasetName = datasetName; |
|||
} |
|||
public String getCategoryProperty() { |
|||
return categoryProperty; |
|||
} |
|||
public void setCategoryProperty(String categoryProperty) { |
|||
this.categoryProperty = categoryProperty; |
|||
} |
|||
public String getSeriesProperty() { |
|||
return seriesProperty; |
|||
} |
|||
public void setSeriesProperty(String seriesProperty) { |
|||
this.seriesProperty = seriesProperty; |
|||
} |
|||
public String getValueProperty() { |
|||
return valueProperty; |
|||
} |
|||
public void setValueProperty(String valueProperty) { |
|||
this.valueProperty = valueProperty; |
|||
} |
|||
public String getCategoryExpression() { |
|||
return categoryExpression; |
|||
} |
|||
public void setCategoryExpression(String categoryExpression) { |
|||
this.categoryExpression = categoryExpression; |
|||
} |
|||
public String getSeriesExpression() { |
|||
return seriesExpression; |
|||
} |
|||
public void setSeriesExpression(String seriesExpression) { |
|||
this.seriesExpression = seriesExpression; |
|||
} |
|||
public String getValueExpression() { |
|||
return valueExpression; |
|||
} |
|||
public void setValueExpression(String valueExpression) { |
|||
this.valueExpression = valueExpression; |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.bstek.ureport.chart.dataset.impl.category; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class HorizontalBarDataset extends BarDataset { |
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
return null; |
|||
} |
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.HorizontalBar; |
|||
} |
|||
} |
@ -0,0 +1,159 @@ |
|||
package com.bstek.ureport.chart.dataset.impl.category; |
|||
|
|||
import com.bstek.ureport.build.Context; |
|||
import com.bstek.ureport.chart.dataset.DatasetType; |
|||
import com.bstek.ureport.chart.dataset.PointStyle; |
|||
import com.bstek.ureport.model.Cell; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class LineDataset extends CategoryDataset{ |
|||
private double[] data; |
|||
private String label; |
|||
private String backgroundColor; |
|||
private String borderColor; |
|||
private int borderWidth; |
|||
private boolean fill; |
|||
private double lineTension=0.2; |
|||
private String pointBackgroundColor; |
|||
private String pointBorderColor; |
|||
private int pointBorderWidth; |
|||
private int pointRadius; |
|||
private PointStyle pointStyle; |
|||
private int pointHitRadius; |
|||
private String pointHoverBackgroundColor; |
|||
private String pointHoverBorderColor; |
|||
private int pointHoverBorderWidth; |
|||
private int pointHoverRadius; |
|||
@Override |
|||
public String buildConfiguration(Context context,Cell cell) { |
|||
StringBuilder sb=new StringBuilder(); |
|||
sb.append("{"); |
|||
if(label!=null){ |
|||
sb.append("label:\""+label+"\""); |
|||
} |
|||
sb.append(""); |
|||
sb.append(""); |
|||
sb.append(""); |
|||
sb.append(""); |
|||
sb.append(""); |
|||
sb.append(""); |
|||
sb.append(""); |
|||
sb.append("}"); |
|||
return sb.toString(); |
|||
} |
|||
@Override |
|||
public DatasetType getDatasetType() { |
|||
return DatasetType.Line; |
|||
} |
|||
@Override |
|||
public String type() { |
|||
return "line"; |
|||
} |
|||
|
|||
public double[] getData() { |
|||
return data; |
|||
} |
|||
public void setData(double[] data) { |
|||
this.data = data; |
|||
} |
|||
|
|||
public String getLabel() { |
|||
return label; |
|||
} |
|||
public void setLabel(String label) { |
|||
this.label = label; |
|||
} |
|||
public String getBackgroundColor() { |
|||
return backgroundColor; |
|||
} |
|||
public void setBackgroundColor(String backgroundColor) { |
|||
this.backgroundColor = backgroundColor; |
|||
} |
|||
public String getBorderColor() { |
|||
return borderColor; |
|||
} |
|||
public void setBorderColor(String borderColor) { |
|||
this.borderColor = borderColor; |
|||
} |
|||
public int getBorderWidth() { |
|||
return borderWidth; |
|||
} |
|||
public void setBorderWidth(int borderWidth) { |
|||
this.borderWidth = borderWidth; |
|||
} |
|||
public boolean isFill() { |
|||
return fill; |
|||
} |
|||
public void setFill(boolean fill) { |
|||
this.fill = fill; |
|||
} |
|||
public double getLineTension() { |
|||
return lineTension; |
|||
} |
|||
public void setLineTension(double lineTension) { |
|||
this.lineTension = lineTension; |
|||
} |
|||
public String getPointBackgroundColor() { |
|||
return pointBackgroundColor; |
|||
} |
|||
public void setPointBackgroundColor(String pointBackgroundColor) { |
|||
this.pointBackgroundColor = pointBackgroundColor; |
|||
} |
|||
public String getPointBorderColor() { |
|||
return pointBorderColor; |
|||
} |
|||
public void setPointBorderColor(String pointBorderColor) { |
|||
this.pointBorderColor = pointBorderColor; |
|||
} |
|||
public int getPointBorderWidth() { |
|||
return pointBorderWidth; |
|||
} |
|||
public void setPointBorderWidth(int pointBorderWidth) { |
|||
this.pointBorderWidth = pointBorderWidth; |
|||
} |
|||
public int getPointRadius() { |
|||
return pointRadius; |
|||
} |
|||
public void setPointRadius(int pointRadius) { |
|||
this.pointRadius = pointRadius; |
|||
} |
|||
public PointStyle getPointStyle() { |
|||
return pointStyle; |
|||
} |
|||
public void setPointStyle(PointStyle pointStyle) { |
|||
this.pointStyle = pointStyle; |
|||
} |
|||
public int getPointHitRadius() { |
|||
return pointHitRadius; |
|||
} |
|||
public void setPointHitRadius(int pointHitRadius) { |
|||
this.pointHitRadius = pointHitRadius; |
|||
} |
|||
public String getPointHoverBackgroundColor() { |
|||
return pointHoverBackgroundColor; |
|||
} |
|||
public void setPointHoverBackgroundColor(String pointHoverBackgroundColor) { |
|||
this.pointHoverBackgroundColor = pointHoverBackgroundColor; |
|||
} |
|||
public String getPointHoverBorderColor() { |
|||
return pointHoverBorderColor; |
|||
} |
|||
public void setPointHoverBorderColor(String pointHoverBorderColor) { |
|||
this.pointHoverBorderColor = pointHoverBorderColor; |
|||
} |
|||
public int getPointHoverBorderWidth() { |
|||
return pointHoverBorderWidth; |
|||
} |
|||
public void setPointHoverBorderWidth(int pointHoverBorderWidth) { |
|||
this.pointHoverBorderWidth = pointHoverBorderWidth; |
|||
} |
|||
public int getPointHoverRadius() { |
|||
return pointHoverRadius; |
|||
} |
|||
public void setPointHoverRadius(int pointHoverRadius) { |
|||
this.pointHoverRadius = pointHoverRadius; |
|||
} |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.bstek.ureport.chart.option; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public enum Easing { |
|||
linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint, easeInSine, easeOutSine, easeInOutSine, easeInExpo, easeOutExpo, easeInOutExpo, easeInCirc, easeOutCirc, easeInOutCirc, easeInElastic, easeOutElastic, easeInOutElastic, easeInBack, easeOutBack, easeInOutBack, easeInBounce, easeOutBounce, easeInOutBounce |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.bstek.ureport.chart.option; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public enum FontStyle { |
|||
normal,italic,bold; |
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.bstek.ureport.chart.option; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class Labels { |
|||
private int boxWidth=40; |
|||
private int fontSize=12; |
|||
private FontStyle fontStyle=FontStyle.normal; |
|||
private String fontColor="#666"; |
|||
private String fontFamily="'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"; |
|||
private int padding=10; |
|||
public int getBoxWidth() { |
|||
return boxWidth; |
|||
} |
|||
public void setBoxWidth(int boxWidth) { |
|||
this.boxWidth = boxWidth; |
|||
} |
|||
public int getFontSize() { |
|||
return fontSize; |
|||
} |
|||
public void setFontSize(int fontSize) { |
|||
this.fontSize = fontSize; |
|||
} |
|||
public FontStyle getFontStyle() { |
|||
return fontStyle; |
|||
} |
|||
public void setFontStyle(FontStyle fontStyle) { |
|||
this.fontStyle = fontStyle; |
|||
} |
|||
public String getFontColor() { |
|||
return fontColor; |
|||
} |
|||
public void setFontColor(String fontColor) { |
|||
this.fontColor = fontColor; |
|||
} |
|||
public String getFontFamily() { |
|||
return fontFamily; |
|||
} |
|||
public void setFontFamily(String fontFamily) { |
|||
this.fontFamily = fontFamily; |
|||
} |
|||
public int getPadding() { |
|||
return padding; |
|||
} |
|||
public void setPadding(int padding) { |
|||
this.padding = padding; |
|||
} |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.bstek.ureport.chart.option; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public interface Option { |
|||
String getConfiguration(); |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.bstek.ureport.chart.option; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class Padding { |
|||
private int left; |
|||
private int right; |
|||
private int top; |
|||
private int bottom; |
|||
public int getLeft() { |
|||
return left; |
|||
} |
|||
public void setLeft(int left) { |
|||
this.left = left; |
|||
} |
|||
public int getRight() { |
|||
return right; |
|||
} |
|||
public void setRight(int right) { |
|||
this.right = right; |
|||
} |
|||
public int getTop() { |
|||
return top; |
|||
} |
|||
public void setTop(int top) { |
|||
this.top = top; |
|||
} |
|||
public int getBottom() { |
|||
return bottom; |
|||
} |
|||
public void setBottom(int bottom) { |
|||
this.bottom = bottom; |
|||
} |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.bstek.ureport.chart.option; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public enum Position { |
|||
left,right,top,bottom; |
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.bstek.ureport.chart.option.impl; |
|||
|
|||
import com.bstek.ureport.chart.option.Easing; |
|||
import com.bstek.ureport.chart.option.Option; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class AnimationsOption implements Option { |
|||
private int duration=1000; |
|||
private Easing easing=Easing.easeOutQuart; |
|||
@Override |
|||
public String getConfiguration() { |
|||
return null; |
|||
} |
|||
public int getDuration() { |
|||
return duration; |
|||
} |
|||
public void setDuration(int duration) { |
|||
this.duration = duration; |
|||
} |
|||
public Easing getEasing() { |
|||
return easing; |
|||
} |
|||
public void setEasing(Easing easing) { |
|||
this.easing = easing; |
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.bstek.ureport.chart.option.impl; |
|||
|
|||
import com.bstek.ureport.chart.option.Option; |
|||
import com.bstek.ureport.chart.option.Padding; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class LayoutOption implements Option { |
|||
private Padding padding; |
|||
@Override |
|||
public String getConfiguration() { |
|||
return null; |
|||
} |
|||
public Padding getPadding() { |
|||
return padding; |
|||
} |
|||
|
|||
public void setPadding(Padding padding) { |
|||
this.padding = padding; |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.bstek.ureport.chart.option.impl; |
|||
|
|||
import com.bstek.ureport.chart.option.Labels; |
|||
import com.bstek.ureport.chart.option.Option; |
|||
import com.bstek.ureport.chart.option.Position; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class LegendOption implements Option { |
|||
private boolean display=true; |
|||
private Position position=Position.top; |
|||
private Labels labels; |
|||
@Override |
|||
public String getConfiguration() { |
|||
return null; |
|||
} |
|||
public boolean isDisplay() { |
|||
return display; |
|||
} |
|||
public void setDisplay(boolean display) { |
|||
this.display = display; |
|||
} |
|||
public Position getPosition() { |
|||
return position; |
|||
} |
|||
public void setPosition(Position position) { |
|||
this.position = position; |
|||
} |
|||
public Labels getLabels() { |
|||
return labels; |
|||
} |
|||
public void setLabels(Labels labels) { |
|||
this.labels = labels; |
|||
} |
|||
} |
@ -0,0 +1,72 @@ |
|||
package com.bstek.ureport.chart.option.impl; |
|||
|
|||
import com.bstek.ureport.chart.option.FontStyle; |
|||
import com.bstek.ureport.chart.option.Option; |
|||
import com.bstek.ureport.chart.option.Position; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class TitleOption implements Option { |
|||
private boolean display; |
|||
private Position position=Position.top; |
|||
private int fontSize=12; |
|||
private String fontFamily="'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"; |
|||
private String fontColor="#666"; |
|||
private FontStyle fontStyle=FontStyle.bold; |
|||
private int padding=10; |
|||
private String text; |
|||
@Override |
|||
public String getConfiguration() { |
|||
return null; |
|||
} |
|||
public boolean isDisplay() { |
|||
return display; |
|||
} |
|||
public void setDisplay(boolean display) { |
|||
this.display = display; |
|||
} |
|||
public Position getPosition() { |
|||
return position; |
|||
} |
|||
public void setPosition(Position position) { |
|||
this.position = position; |
|||
} |
|||
public int getFontSize() { |
|||
return fontSize; |
|||
} |
|||
public void setFontSize(int fontSize) { |
|||
this.fontSize = fontSize; |
|||
} |
|||
public String getFontFamily() { |
|||
return fontFamily; |
|||
} |
|||
public void setFontFamily(String fontFamily) { |
|||
this.fontFamily = fontFamily; |
|||
} |
|||
public String getFontColor() { |
|||
return fontColor; |
|||
} |
|||
public void setFontColor(String fontColor) { |
|||
this.fontColor = fontColor; |
|||
} |
|||
public FontStyle getFontStyle() { |
|||
return fontStyle; |
|||
} |
|||
public void setFontStyle(FontStyle fontStyle) { |
|||
this.fontStyle = fontStyle; |
|||
} |
|||
public int getPadding() { |
|||
return padding; |
|||
} |
|||
public void setPadding(int padding) { |
|||
this.padding = padding; |
|||
} |
|||
public String getText() { |
|||
return text; |
|||
} |
|||
public void setText(String text) { |
|||
this.text = text; |
|||
} |
|||
} |
@ -0,0 +1,98 @@ |
|||
package com.bstek.ureport.chart.option.impl; |
|||
|
|||
import com.bstek.ureport.chart.option.FontStyle; |
|||
import com.bstek.ureport.chart.option.Option; |
|||
|
|||
/** |
|||
* @author Jacky.gao |
|||
* @since 2017年6月8日 |
|||
*/ |
|||
public class TooltipOption implements Option { |
|||
private boolean enabled=true; |
|||
private String titleFontFamily="'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"; |
|||
private int titleFontSize=12; |
|||
private FontStyle titleFontStyle=FontStyle.bold; |
|||
private String titleFontColor="#fff"; |
|||
private String bodyFontFamily="'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"; |
|||
private int bodyFontSize=12; |
|||
private FontStyle bodyFontStyle=FontStyle.normal; |
|||
private String bodyFontColor="#fff"; |
|||
|
|||
@Override |
|||
public String getConfiguration() { |
|||
return null; |
|||
} |
|||
|
|||
public boolean isEnabled() { |
|||
return enabled; |
|||
} |
|||
|
|||
public void setEnabled(boolean enabled) { |
|||
this.enabled = enabled; |
|||
} |
|||
|
|||
public String getTitleFontFamily() { |
|||
return titleFontFamily; |
|||
} |
|||
|
|||
public void setTitleFontFamily(String titleFontFamily) { |
|||
this.titleFontFamily = titleFontFamily; |
|||
} |
|||
|
|||
public int getTitleFontSize() { |
|||
return titleFontSize; |
|||
} |
|||
|
|||
public void setTitleFontSize(int titleFontSize) { |
|||
this.titleFontSize = titleFontSize; |
|||
} |
|||
|
|||
public FontStyle getTitleFontStyle() { |
|||
return titleFontStyle; |
|||
} |
|||
|
|||
public void setTitleFontStyle(FontStyle titleFontStyle) { |
|||
this.titleFontStyle = titleFontStyle; |
|||
} |
|||
|
|||
public String getTitleFontColor() { |
|||
return titleFontColor; |
|||
} |
|||
|
|||
public void setTitleFontColor(String titleFontColor) { |
|||
this.titleFontColor = titleFontColor; |
|||
} |
|||
|
|||
public String getBodyFontFamily() { |
|||
return bodyFontFamily; |
|||
} |
|||
|
|||
public void setBodyFontFamily(String bodyFontFamily) { |
|||
this.bodyFontFamily = bodyFontFamily; |
|||
} |
|||
|
|||
public int getBodyFontSize() { |
|||
return bodyFontSize; |
|||
} |
|||
|
|||
public void setBodyFontSize(int bodyFontSize) { |
|||
this.bodyFontSize = bodyFontSize; |
|||
} |
|||
|
|||
public FontStyle getBodyFontStyle() { |
|||
return bodyFontStyle; |
|||
} |
|||
|
|||
public void setBodyFontStyle(FontStyle bodyFontStyle) { |
|||
this.bodyFontStyle = bodyFontStyle; |
|||
} |
|||
|
|||
public String getBodyFontColor() { |
|||
return bodyFontColor; |
|||
} |
|||
|
|||
public void setBodyFontColor(String bodyFontColor) { |
|||
this.bodyFontColor = bodyFontColor; |
|||
} |
|||
|
|||
} |
Carregando…
Reference in new issue