Pārlūkot izejas kodu

修复三元表达式不能与字符串拼接的BUG

master
jacky6024 pirms 7 gadiem
vecāks
revīzija
ff1e9094d5
  1. 9
      ureport2-core/dsl/ReportParser.g4
  2. 3
      ureport2-core/src/main/java/com/bstek/ureport/build/compute/ChartValueCompute.java
  3. 7
      ureport2-core/src/main/java/com/bstek/ureport/chart/Chart.java
  4. 20
      ureport2-core/src/main/java/com/bstek/ureport/chart/ChartData.java
  5. 15
      ureport2-core/src/main/java/com/bstek/ureport/chart/axes/Axes.java
  6. 15
      ureport2-core/src/main/java/com/bstek/ureport/chart/axes/BaseAxes.java
  7. 15
      ureport2-core/src/main/java/com/bstek/ureport/chart/axes/ScaleLabel.java
  8. 15
      ureport2-core/src/main/java/com/bstek/ureport/chart/axes/XPosition.java
  9. 15
      ureport2-core/src/main/java/com/bstek/ureport/chart/axes/YPosition.java
  10. 15
      ureport2-core/src/main/java/com/bstek/ureport/chart/axes/impl/XAxes.java
  11. 15
      ureport2-core/src/main/java/com/bstek/ureport/chart/axes/impl/YAxes.java
  12. 30
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/BubbleData.java
  13. 15
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/CollectType.java
  14. 3
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/Dataset.java
  15. 17
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/ScatterData.java
  16. 158
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/BubbleDataset.java
  17. 37
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/MixDataset.java
  18. 114
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/PieDataset.java
  19. 114
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/PolarDataset.java
  20. 197
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/RadarDataset.java
  21. 195
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/ScatterDataset.java
  22. 14
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/AreaDataset.java
  23. 44
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/BarDataset.java
  24. 104
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/CategoryDataset.java
  25. 5
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/DoughnutDataset.java
  26. 16
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/HorizontalBarDataset.java
  27. 88
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/LineDataset.java
  28. 26
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/PieDataset.java
  29. 42
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/PolarDataset.java
  30. 62
      ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/RadarDataset.java
  31. 28
      ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserBaseVisitor.java
  32. 1046
      ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserParser.java
  33. 28
      ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserVisitor.java
  34. 7
      ureport2-core/src/main/java/com/bstek/ureport/export/html/HtmlProducer.java
  35. 48
      ureport2-core/src/main/java/com/bstek/ureport/expression/parse/ExpressionVisitor.java
  36. 5
      ureport2-core/src/main/resources/ureport-core-context.xml
  37. 316
      ureport2-core/src/main/resources/ureport2.xsd

9
ureport2-core/dsl/ReportParser.g4

@ -1,12 +1,17 @@
grammar ReportParser;
import ReportLexer;
expression : expr
| ternaryExpr
expression : exprComposite
| ifExpr
| caseExpr
;
exprComposite : expr #singleExprComposite
| ternaryExpr #ternaryExprComposite
| LeftParen exprComposite RightParen #parenExprComposite
| exprComposite Operator exprComposite #complexExprComposite
;
ternaryExpr : ifCondition (join ifCondition)* '?' expr ':' expr ;
caseExpr : 'case' '{' casePart (',' casePart)* '}' ;

3
ureport2-core/src/main/java/com/bstek/ureport/build/compute/ChartValueCompute.java

@ -21,6 +21,7 @@ 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.chart.ChartData;
import com.bstek.ureport.definition.value.ChartValue;
import com.bstek.ureport.definition.value.ValueType;
import com.bstek.ureport.model.Cell;
@ -35,7 +36,7 @@ public class ChartValueCompute implements ValueCompute {
public List<BindData> compute(Cell cell, Context context) {
ChartValue chartValue=(ChartValue)cell.getValue();
Chart chart=chartValue.getChart();
String data=chart.doCompute(cell, context);
ChartData data=chart.doCompute(cell, context);
List<BindData> list=new ArrayList<BindData>();
list.add(new BindData(data));
return list;

7
ureport2-core/src/main/java/com/bstek/ureport/chart/Chart.java

@ -33,10 +33,10 @@ public class Chart {
private Dataset dataset;
private XAxes xaxes;
private YAxes yaxes;
public String doCompute(Cell cell, Context context){
public ChartData doCompute(Cell cell, Context context){
StringBuilder sb=new StringBuilder();
sb.append("{");
sb.append("type:\""+dataset.type()+"\",");
sb.append("type:\""+dataset.getType()+"\",");
sb.append("data:"+dataset.buildDataJson(context, cell)+",");
sb.append("options:{");
if(options!=null && options.size()>0){
@ -61,7 +61,8 @@ public class Chart {
}
sb.append("}");
sb.append("}");
return sb.toString();
ChartData chartData=new ChartData(sb.toString());
return chartData;
}
public List<Option> getOptions() {

20
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/DatasetType.java → ureport2-core/src/main/java/com/bstek/ureport/chart/ChartData.java

@ -13,12 +13,24 @@
* License for the specific language governing permissions and limitations under
* the License.
******************************************************************************/
package com.bstek.ureport.chart.dataset;
package com.bstek.ureport.chart;
/**
* @author Jacky.gao
* @since 2017年6月8
* @since 2017年6月16
*/
public enum DatasetType {
Line,Bar,HorizontalBar,Radar,Pie,Polar,Bubble,Scatter,Area,Mix
public class ChartData {
private String json;
public ChartData(String json) {
this.json=json;
}
public String buildJavascript(String canvasId){
StringBuilder sb=new StringBuilder();
sb.append("<script>");
sb.append("$(document).ready(function(){");
sb.append("_buildChart(\""+canvasId+"\","+json+");");
sb.append(" });");
sb.append("</script>");
return sb.toString();
}
}

15
ureport2-core/src/main/java/com/bstek/ureport/chart/axes/Axes.java

@ -1,3 +1,18 @@
/*******************************************************************************
* 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.chart.axes;
/**

15
ureport2-core/src/main/java/com/bstek/ureport/chart/axes/BaseAxes.java

@ -1,3 +1,18 @@
/*******************************************************************************
* 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.chart.axes;
/**

15
ureport2-core/src/main/java/com/bstek/ureport/chart/axes/ScaleLabel.java

@ -1,3 +1,18 @@
/*******************************************************************************
* 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.chart.axes;
import com.bstek.ureport.chart.FontStyle;

15
ureport2-core/src/main/java/com/bstek/ureport/chart/axes/XPosition.java

@ -1,3 +1,18 @@
/*******************************************************************************
* 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.chart.axes;
/**

15
ureport2-core/src/main/java/com/bstek/ureport/chart/axes/YPosition.java

@ -1,3 +1,18 @@
/*******************************************************************************
* 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.chart.axes;
/**

15
ureport2-core/src/main/java/com/bstek/ureport/chart/axes/impl/XAxes.java

@ -1,3 +1,18 @@
/*******************************************************************************
* 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.chart.axes.impl;
import com.bstek.ureport.chart.axes.BaseAxes;

15
ureport2-core/src/main/java/com/bstek/ureport/chart/axes/impl/YAxes.java

@ -1,3 +1,18 @@
/*******************************************************************************
* 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.chart.axes.impl;
import com.bstek.ureport.chart.axes.BaseAxes;

30
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/BubbleData.java

@ -20,25 +20,37 @@ package com.bstek.ureport.chart.dataset;
* @since 2017年6月8日
*/
public class BubbleData {
private int x;
private int y;
private int r;
public int getX() {
private double x;
private double y;
private double r;
public BubbleData(double x, double y, double r) {
this.x = x;
this.y = y;
this.r = r;
}
public double getX() {
return x;
}
public void setX(int x) {
public void setX(double x) {
this.x = x;
}
public int getY() {
public double getY() {
return y;
}
public void setY(int y) {
public void setY(double y) {
this.y = y;
}
public int getR() {
public double getR() {
return r;
}
public void setR(int r) {
public void setR(double r) {
this.r = r;
}
}

15
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/CollectType.java

@ -1,3 +1,18 @@
/*******************************************************************************
* 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.chart.dataset;
/**

3
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/Dataset.java

@ -24,6 +24,5 @@ import com.bstek.ureport.model.Cell;
*/
public interface Dataset {
String buildDataJson(Context context,Cell cell);
DatasetType getDatasetType();
String type();
String getType();
}

17
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/ScatterData.java

@ -20,18 +20,23 @@ package com.bstek.ureport.chart.dataset;
* @since 2017年6月8日
*/
public class ScatterData {
private int x;
private int y;
public int getX() {
private double x;
private double y;
public ScatterData(double x, double y) {
this.x = x;
this.y = y;
}
public double getX() {
return x;
}
public void setX(int x) {
public void setX(double x) {
this.x = x;
}
public int getY() {
public double getY() {
return y;
}
public void setY(int y) {
public void setY(double y) {
this.y = y;
}
}

158
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/BubbleDataset.java

@ -15,90 +15,124 @@
******************************************************************************/
package com.bstek.ureport.chart.dataset.impl;
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.BubbleData;
import com.bstek.ureport.chart.dataset.Dataset;
import com.bstek.ureport.chart.dataset.DatasetType;
import com.bstek.ureport.model.Cell;
import com.bstek.ureport.utils.DataUtils;
/**
* @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;
public class BubbleDataset extends BaseDataset {
private String datasetName;
private String xProperty;
private String yProperty;
private String rProperty;
private String categoryProperty;
@Override
public String buildDataJson(Context context,Cell cell) {
return null;
}
@Override
public DatasetType getDatasetType() {
return DatasetType.Bubble;
Map<Object,List<BubbleData>> map=new HashMap<Object,List<BubbleData>>();
List<?> dataList=DataUtils.fetchData(cell, context, datasetName);
for(Object obj:dataList){
if(obj==null){
continue;
}
Object categoryValue=Utils.getProperty(obj, categoryProperty);
if(categoryValue==null){
continue;
}
Object xValue=Utils.getProperty(obj, xProperty);
Object yValue=Utils.getProperty(obj, yProperty);
Object rValue=Utils.getProperty(obj, rProperty);
if(xValue==null || yValue==null || rValue==null){
continue;
}
List<BubbleData> list=null;
if(map.containsKey(categoryValue)){
list=map.get(categoryValue);
}else{
list=new ArrayList<BubbleData>();
map.put(categoryValue, list);
}
double x=Utils.toBigDecimal(xValue).doubleValue();
double y=Utils.toBigDecimal(yValue).doubleValue();
double r=Utils.toBigDecimal(rValue).doubleValue();
list.add(new BubbleData(x,y,r));
}
StringBuilder sb=new StringBuilder();
sb.append("[");
int index=0;
for(Object obj:map.keySet()){
if(index>0){
sb.append(",");
}
sb.append("{");
sb.append("label:\""+obj+"\",");
sb.append("data:[");
List<BubbleData> list=map.get(obj);
int i=0;
for(BubbleData data:list){
if(i>0){
sb.append(",");
}
i++;
sb.append("{");
sb.append("x:"+data.getX()+",");
sb.append("y:"+data.getY()+",");
sb.append("r:"+data.getR());
sb.append("}");
}
sb.append("],");
sb.append("backgroundColor:\""+getRgbColor(index)+"\"");
sb.append("}");
index++;
}
sb.append("]");
return sb.toString();
}
@Override
public String type() {
public String getType() {
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 String getDatasetName() {
return datasetName;
}
public void setBorderWidth(int borderWidth) {
this.borderWidth = borderWidth;
public void setDatasetName(String datasetName) {
this.datasetName = datasetName;
}
public String getHoverBackgroundColor() {
return hoverBackgroundColor;
public String getCategoryProperty() {
return categoryProperty;
}
public void setHoverBackgroundColor(String hoverBackgroundColor) {
this.hoverBackgroundColor = hoverBackgroundColor;
public void setCategoryProperty(String categoryProperty) {
this.categoryProperty = categoryProperty;
}
public String getHoverBorderColor() {
return hoverBorderColor;
public String getxProperty() {
return xProperty;
}
public void setHoverBorderColor(String hoverBorderColor) {
this.hoverBorderColor = hoverBorderColor;
public void setxProperty(String xProperty) {
this.xProperty = xProperty;
}
public int getHoverBorderWidth() {
return hoverBorderWidth;
public String getyProperty() {
return yProperty;
}
public void setHoverBorderWidth(int hoverBorderWidth) {
this.hoverBorderWidth = hoverBorderWidth;
public void setyProperty(String yProperty) {
this.yProperty = yProperty;
}
public int getHoverRadius() {
return hoverRadius;
public String getrProperty() {
return rProperty;
}
public void setHoverRadius(int hoverRadius) {
this.hoverRadius = hoverRadius;
public void setrProperty(String rProperty) {
this.rProperty = rProperty;
}
}

37
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/MixDataset.java

@ -20,9 +20,9 @@ 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.exception.ReportComputeException;
import com.bstek.ureport.model.Cell;
/**
@ -35,16 +35,39 @@ public class MixDataset implements Dataset {
@Override
public String buildDataJson(Context context,Cell cell) {
return null;
StringBuilder sb=new StringBuilder();
sb.append("{");
sb.append("datasets:[");
int index=0;
for(BarDataset ds:barDatasets){
if(index>0){
sb.append(",");
}
sb.append(ds.toMixJson(context, cell, index));
}
for(LineDataset ds:lineDatasets){
if(index>0){
sb.append(",");
}
sb.append(ds.toMixJson(context, cell, index));
}
sb.append("],");
String labels=null;
if(barDatasets.size()>0){
labels=barDatasets.get(0).getLabels();
}else if(lineDatasets.size()>0){
labels=lineDatasets.get(0).getLabels();
}else{
throw new ReportComputeException("Mix chart need one dataset at least.");
}
sb.append("labels:"+labels);
sb.append("}");
return sb.toString();
}
@Override
public DatasetType getDatasetType() {
return DatasetType.Mix;
}
@Override
public String type() {
public String getType() {
return "bar";
}

114
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/PieDataset.java

@ -1,114 +0,0 @@
/*******************************************************************************
* 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.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 buildDataJson(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;
}
}

114
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/PolarDataset.java

@ -1,114 +0,0 @@
/*******************************************************************************
* 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.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 buildDataJson(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;
}
}

197
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/RadarDataset.java

@ -1,197 +0,0 @@
/*******************************************************************************
* 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.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 buildDataJson(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;
}
}

195
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/ScatterDataset.java

@ -15,76 +15,117 @@
******************************************************************************/
package com.bstek.ureport.chart.dataset.impl;
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.Dataset;
import com.bstek.ureport.chart.dataset.DatasetType;
import com.bstek.ureport.chart.dataset.PointStyle;
import com.bstek.ureport.chart.dataset.BaseDataset;
import com.bstek.ureport.chart.dataset.ScatterData;
import com.bstek.ureport.model.Cell;
import com.bstek.ureport.utils.DataUtils;
/**
* @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;
public class ScatterDataset extends BaseDataset {
private String datasetName;
private String categoryProperty;
private String xProperty;
private String yProperty;
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 buildDataJson(Context context,Cell cell) {
return null;
}
@Override
public DatasetType getDatasetType() {
return DatasetType.Scatter;
List<?> dataList=DataUtils.fetchData(cell, context, datasetName);
Map<Object,List<ScatterData>> map=new HashMap<Object,List<ScatterData>>();
for(Object obj:dataList){
Object category=Utils.getProperty(obj, categoryProperty);
if(category==null){
continue;
}
Object xValue=Utils.getProperty(obj, xProperty);
Object yValue=Utils.getProperty(obj, yProperty);
if(xValue==null || yValue==null){
continue;
}
double x=Utils.toBigDecimal(xValue).doubleValue();
double y=Utils.toBigDecimal(yValue).doubleValue();
List<ScatterData> list=null;
if(map.containsKey(category)){
list=map.get(category);
}else{
list=new ArrayList<ScatterData>();
map.put(category, list);
}
list.add(new ScatterData(x,y));
}
StringBuilder sb=new StringBuilder();
sb.append("[");
int index=0;
for(Object obj:map.keySet()){
if(index>0){
sb.append(",");
}
index++;
sb.append("{");
sb.append("label:\""+obj+"\",");
sb.append("fill:"+fill+",");
sb.append("lineTension:"+lineTension+",");
sb.append("borderColor:\"rgb("+getRgbColor(index)+")\",");
sb.append("backgroundColor:\"rgba("+getRgbColor(index)+",0.5)\",");
sb.append("data:[");
List<ScatterData> list=map.get(obj);
int i=0;
for(ScatterData data:list){
if(i>0){
sb.append(",");
}
i++;
sb.append("{");
sb.append("x:"+data.getX()+",");
sb.append("y:"+data.getY()+"");
sb.append("}");
}
sb.append("]");
sb.append("}");
}
sb.append("]");
return sb.toString();
}
@Override
public String type() {
public String getType() {
return "scatter";
}
public ScatterData getData() {
return data;
}
public void setData(ScatterData data) {
this.data = data;
public String getDatasetName() {
return datasetName;
}
public String getLabel() {
return label;
public void setDatasetName(String datasetName) {
this.datasetName = datasetName;
}
public void setLabel(String label) {
this.label = label;
public String getCategoryProperty() {
return categoryProperty;
}
public String getBackgroundColor() {
return backgroundColor;
public void setCategoryProperty(String categoryProperty) {
this.categoryProperty = categoryProperty;
}
public void setBackgroundColor(String backgroundColor) {
this.backgroundColor = backgroundColor;
public String getxProperty() {
return xProperty;
}
public String getBorderColor() {
return borderColor;
public void setxProperty(String xProperty) {
this.xProperty = xProperty;
}
public void setBorderColor(String borderColor) {
this.borderColor = borderColor;
public String getyProperty() {
return yProperty;
}
public int getBorderWidth() {
return borderWidth;
}
public void setBorderWidth(int borderWidth) {
this.borderWidth = borderWidth;
public void setyProperty(String yProperty) {
this.yProperty = yProperty;
}
public boolean isFill() {
return fill;
@ -98,64 +139,4 @@ public class ScatterDataset implements Dataset {
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;
}
}

14
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/AreaDataset.java

@ -16,7 +16,6 @@
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;
/**
@ -26,10 +25,13 @@ import com.bstek.ureport.model.Cell;
public class AreaDataset extends LineDataset {
@Override
public String buildDataJson(Context context,Cell cell) {
return null;
}
@Override
public DatasetType getDatasetType() {
return DatasetType.Area;
String datasetJson=buildDatasetJson(context, cell,null);
StringBuilder sb=new StringBuilder();
sb.append("{");
String labels=getLabels();
sb.append("labels:"+labels+",");
sb.append("datasets:["+datasetJson+"]");
sb.append("}");
return sb.toString();
}
}

44
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/BarDataset.java

@ -16,7 +16,6 @@
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;
/**
@ -24,38 +23,25 @@ import com.bstek.ureport.model.Cell;
* @since 2017年6月8日
*/
public class BarDataset extends CategoryDataset{
private String hoverBackgroundColor;
private String hoverBorderColor;
private String hoverBorderWidth;
@Override
public String buildDataJson(Context context,Cell cell) {
return null;
}
@Override
public DatasetType getDatasetType() {
return DatasetType.Bar;
String datasetJson=buildDatasetJson(context, cell,null);
StringBuilder sb=new StringBuilder();
sb.append("{");
String labels=getLabels();
sb.append("labels:"+labels+",");
sb.append("datasets:["+datasetJson+"]");
sb.append("}");
return sb.toString();
}
public String toMixJson(Context context,Cell cell,int index){
String props="type:\"bar\"";
String datasetJson=buildDatasetJson(context, cell,props);
return datasetJson;
}
@Override
public String type() {
public String getType() {
return "bar";
}
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;
}
}

104
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/CategoryDataset.java

@ -30,7 +30,6 @@ import com.bstek.ureport.Utils;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.chart.dataset.BaseDataset;
import com.bstek.ureport.chart.dataset.CollectType;
import com.bstek.ureport.chart.dataset.Source;
import com.bstek.ureport.exception.ReportComputeException;
import com.bstek.ureport.model.Cell;
import com.bstek.ureport.utils.DataUtils;
@ -41,7 +40,6 @@ import com.bstek.ureport.utils.DataUtils;
* @since 2017年6月9日
*/
public abstract class CategoryDataset extends BaseDataset {
private Source source=Source.dataset;
private CollectType collectType=CollectType.select;
private String datasetName;
@ -49,17 +47,13 @@ public abstract class CategoryDataset extends BaseDataset {
private String seriesProperty;
private String valueProperty;
private String categoryExpression;
private String seriesExpression;
private String valueExpression;
private String labels;
private String format;
protected String buildDatasetJson(Context context,Cell cell){
protected String buildDatasetJson(Context context,Cell cell,String props){
List<?> dataList=DataUtils.fetchData(cell, context, datasetName);
List<Object> categoryList=new ArrayList<Object>();
Map<Object,Map<Object,List<Double>>> seriesDataMap=new HashMap<Object,Map<Object,List<Double>>>();
Map<Object,Map<Object,List<Object>>> seriesDataMap=new HashMap<Object,Map<Object,List<Object>>>();
for(Object obj:dataList){
Object category=Utils.getProperty(obj, categoryProperty);
if(category==null){
@ -74,36 +68,36 @@ public abstract class CategoryDataset extends BaseDataset {
continue;
}
Object value=Utils.getProperty(obj, valueProperty);
double data=0;
if(value!=null && StringUtils.isNotBlank(value.toString())){
data=Utils.toBigDecimal(value).doubleValue();
if(value==null){
continue;
}
if(seriesDataMap.containsKey(series)){
Map<Object,List<Double>> categoryMap=seriesDataMap.get(series);
List<Double> valueList=null;
Map<Object,List<Object>> categoryMap=seriesDataMap.get(series);
List<Object> valueList=null;
if(categoryMap.containsKey(category)){
valueList=categoryMap.get(category);
}else{
valueList=new ArrayList<Double>();
valueList=new ArrayList<Object>();
categoryMap.put(category, valueList);
}
valueList.add(data);
valueList.add(value);
}else{
Map<Object,List<Double>> categoryMap=new HashMap<Object,List<Double>>();
Map<Object,List<Object>> categoryMap=new HashMap<Object,List<Object>>();
for(Object cg:categoryList){
categoryMap.put(cg, new ArrayList<Double>());
categoryMap.put(cg, new ArrayList<Object>());
}
List<Double> valueList=categoryMap.get(category);
valueList.add(data);
List<Object> valueList=categoryMap.get(category);
valueList.add(value);
}
}
setLabels(toLabel(categoryList));
return buildDatasets(seriesDataMap);
return buildDatasets(seriesDataMap,props);
}
private String buildDatasets(Map<Object,Map<Object,List<Double>>> map){
private String buildDatasets(Map<Object,Map<Object,List<Object>>> map,String props){
StringBuilder sb=new StringBuilder();
sb.append("[");
sb.append("");
int i=0;
for(Object series:map.keySet()){
if(i>0){
@ -129,17 +123,20 @@ public abstract class CategoryDataset extends BaseDataset {
sb.append("fill:false");
}
}
if(props!=null){
sb.append(props);
}
sb.append("}");
}
sb.append("]");
sb.append("");
return sb.toString();
}
private String buildData(Map<Object,List<Double>> categoryMap){
private String buildData(Map<Object,List<Object>> categoryMap){
StringBuilder sb=new StringBuilder();
sb.append("[");
for(Object category:categoryMap.keySet()){
List<Double> list=categoryMap.get(category);
List<Object> list=categoryMap.get(category);
double data=collectData(list);
if(sb.length()>1){
sb.append(",");
@ -150,16 +147,16 @@ public abstract class CategoryDataset extends BaseDataset {
return sb.toString();
}
private double collectData(List<Double> list){
private double collectData(List<Object> list){
double result=0;
switch(collectType){
case select:
result = list.get(0);
result = Utils.toBigDecimal(list.get(0)).doubleValue();
break;
case avg:
double total=0;
for(double data:list){
total+=data;
for(Object data:list){
total+=Utils.toBigDecimal(data).doubleValue();
}
result=Utils.toBigDecimal(total).divide(Utils.toBigDecimal(list.size()),8,BigDecimal.ROUND_HALF_UP).doubleValue();
break;
@ -168,29 +165,32 @@ public abstract class CategoryDataset extends BaseDataset {
break;
case max:
Double max=null;
for(double data:list){
for(Object data:list){
double value=Utils.toBigDecimal(data).doubleValue();
if(max==null){
max=data;
}else if(max<data){
max=data;
max=value;
}else if(max<value){
max=value;
}
}
result=max;
break;
case min:
Double min=null;
for(double data:list){
for(Object data:list){
double value=Utils.toBigDecimal(data).doubleValue();
if(min==null){
min=data;
}else if(min>data){
min=data;
min=value;
}else if(min>value){
min=value;
}
}
result=min;
break;
case sum:
for(double data:list){
result+=data;
for(Object data:list){
double value=Utils.toBigDecimal(data).doubleValue();
result+=value;
}
break;
}
@ -236,12 +236,6 @@ public abstract class CategoryDataset extends BaseDataset {
this.collectType = collectType;
}
public Source getSource() {
return source;
}
public void setSource(Source source) {
this.source = source;
}
public String getDatasetName() {
return datasetName;
}
@ -266,25 +260,7 @@ public abstract class CategoryDataset extends BaseDataset {
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;
}
public void setLabels(String labels) {
this.labels = labels;
}

5
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/DoughnutDataset.java → ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/DoughnutDataset.java

@ -13,7 +13,8 @@
* License for the specific language governing permissions and limitations under
* the License.
******************************************************************************/
package com.bstek.ureport.chart.dataset.impl;
package com.bstek.ureport.chart.dataset.impl.category;
/**
* @author Jacky.gao
@ -21,7 +22,7 @@ package com.bstek.ureport.chart.dataset.impl;
*/
public class DoughnutDataset extends PieDataset {
@Override
public String type() {
public String getType() {
return "doughnut";
}
}

16
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/HorizontalBarDataset.java

@ -16,7 +16,6 @@
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;
/**
@ -26,10 +25,17 @@ import com.bstek.ureport.model.Cell;
public class HorizontalBarDataset extends BarDataset {
@Override
public String buildDataJson(Context context,Cell cell) {
return null;
String datasetJson=buildDatasetJson(context, cell,null);
StringBuilder sb=new StringBuilder();
sb.append("{");
String labels=getLabels();
sb.append("labels:"+labels+",");
sb.append("datasets:["+datasetJson+"]");
sb.append("}");
return sb.toString();
}
@Override
public DatasetType getDatasetType() {
return DatasetType.HorizontalBar;
}
public String getType() {
return "horizontalBar";
}
}

88
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/LineDataset.java

@ -16,8 +16,6 @@
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;
/**
@ -26,33 +24,27 @@ import com.bstek.ureport.model.Cell;
*/
public class LineDataset extends CategoryDataset{
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 buildDataJson(Context context,Cell cell) {
String datasetJson=buildDatasetJson(context, cell);
String props="lineTension:"+lineTension;
String datasetJson=buildDatasetJson(context, cell,props);
StringBuilder sb=new StringBuilder();
sb.append("{");
String labels=getLabels();
sb.append("labels:"+labels+",");
sb.append("datasets:"+datasetJson+"");
sb.append("datasets:["+datasetJson+"]");
sb.append("}");
return sb.toString();
}
@Override
public DatasetType getDatasetType() {
return DatasetType.Line;
public String toMixJson(Context context,Cell cell,int index){
String props="type:\"line\",lineTension:"+lineTension+",fill:false";
String datasetJson=buildDatasetJson(context, cell,props);
return datasetJson;
}
@Override
public String type() {
public String getType() {
return "line";
}
@ -62,64 +54,4 @@ public class LineDataset extends CategoryDataset{
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;
}
}

26
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/Source.java → ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/PieDataset.java

@ -13,12 +13,30 @@
* License for the specific language governing permissions and limitations under
* the License.
******************************************************************************/
package com.bstek.ureport.chart.dataset;
package com.bstek.ureport.chart.dataset.impl.category;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.model.Cell;
/**
* @author Jacky.gao
* @since 2017年6月9
* @since 2017年6月8
*/
public enum Source {
dataset,expression;
public class PieDataset extends CategoryDataset {
@Override
public String buildDataJson(Context context,Cell cell) {
String datasetJson=buildDatasetJson(context, cell,null);
StringBuilder sb=new StringBuilder();
sb.append("{");
String labels=getLabels();
sb.append("labels:"+labels+",");
sb.append("datasets:["+datasetJson+"]");
sb.append("}");
return sb.toString();
}
@Override
public String getType() {
return "pie";
}
}

42
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/PolarDataset.java

@ -0,0 +1,42 @@
/*******************************************************************************
* 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.chart.dataset.impl.category;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.model.Cell;
/**
* @author Jacky.gao
* @since 2017年6月8日
*/
public class PolarDataset extends CategoryDataset {
@Override
public String buildDataJson(Context context, Cell cell) {
String datasetJson=buildDatasetJson(context, cell,null);
StringBuilder sb=new StringBuilder();
sb.append("{");
String labels=getLabels();
sb.append("labels:"+labels+",");
sb.append("datasets:["+datasetJson+"]");
sb.append("}");
return sb.toString();
}
@Override
public String getType() {
return "polarArea";
}
}

62
ureport2-core/src/main/java/com/bstek/ureport/chart/dataset/impl/category/RadarDataset.java

@ -0,0 +1,62 @@
/*******************************************************************************
* 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.chart.dataset.impl.category;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.model.Cell;
/**
* @author Jacky.gao
* @since 2017年6月8日
*/
public class RadarDataset extends CategoryDataset {
private boolean fill;
private double lineTension=0.1;
@Override
public String buildDataJson(Context context,Cell cell) {
String props="fill:"+fill+",lineTension:"+lineTension;
String datasetJson=buildDatasetJson(context, cell,props);
StringBuilder sb=new StringBuilder();
sb.append("{");
String labels=getLabels();
sb.append("labels:"+labels+",");
sb.append("datasets:["+datasetJson+"]");
sb.append("}");
return sb.toString();
}
@Override
public String getType() {
return "radar";
}
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;
}
}

28
ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserBaseVisitor.java

@ -18,6 +18,34 @@ public class ReportParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> impl
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitExpression(ReportParserParser.ExpressionContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitComplexExprComposite(ReportParserParser.ComplexExprCompositeContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitSingleExprComposite(ReportParserParser.SingleExprCompositeContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitParenExprComposite(ReportParserParser.ParenExprCompositeContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitTernaryExprComposite(ReportParserParser.TernaryExprCompositeContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*

1046
ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserParser.java

Failā izmaiņas netiks attēlotas, jo tās ir par lielu

28
ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserVisitor.java

@ -16,6 +16,34 @@ public interface ReportParserVisitor<T> extends ParseTreeVisitor<T> {
* @return the visitor result
*/
T visitExpression(ReportParserParser.ExpressionContext ctx);
/**
* Visit a parse tree produced by the {@code complexExprComposite}
* labeled alternative in {@link ReportParserParser#exprComposite}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitComplexExprComposite(ReportParserParser.ComplexExprCompositeContext ctx);
/**
* Visit a parse tree produced by the {@code singleExprComposite}
* labeled alternative in {@link ReportParserParser#exprComposite}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSingleExprComposite(ReportParserParser.SingleExprCompositeContext ctx);
/**
* Visit a parse tree produced by the {@code parenExprComposite}
* labeled alternative in {@link ReportParserParser#exprComposite}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitParenExprComposite(ReportParserParser.ParenExprCompositeContext ctx);
/**
* Visit a parse tree produced by the {@code ternaryExprComposite}
* labeled alternative in {@link ReportParserParser#exprComposite}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTernaryExprComposite(ReportParserParser.TernaryExprCompositeContext ctx);
/**
* Visit a parse tree produced by {@link ReportParserParser#ternaryExpr}.
* @param ctx the parse tree

7
ureport2-core/src/main/java/com/bstek/ureport/export/html/HtmlProducer.java

@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.build.paging.Page;
import com.bstek.ureport.chart.ChartData;
import com.bstek.ureport.definition.Alignment;
import com.bstek.ureport.definition.Border;
import com.bstek.ureport.definition.CellStyle;
@ -161,10 +162,16 @@ public class HtmlProducer{
}
sb.append("<img src=\"data:"+imageType+";base64,"+img.getBase64Data()+"\"");
sb.append(">");
}else if(obj instanceof ChartData){
String canvasId="_canvas_"+cell.getName()+i+"-"+j;
sb.append("<canvas id=\""+canvasId+"\"></canvas>");
ChartData chartData=(ChartData)obj;
sb.append(chartData.buildJavascript(canvasId));
}else{
String text=obj.toString();
text=text.replaceAll("\r\n", "<br>");
text=text.replaceAll("\n", "<br>");
text=text.replaceAll(" ", "&nbsp;");
sb.append(text);
}
if(hasLink){

48
ureport2-core/src/main/java/com/bstek/ureport/expression/parse/ExpressionVisitor.java

@ -23,8 +23,10 @@ import org.antlr.v4.runtime.tree.TerminalNode;
import com.bstek.ureport.dsl.ReportParserBaseVisitor;
import com.bstek.ureport.dsl.ReportParserParser.CaseExprContext;
import com.bstek.ureport.dsl.ReportParserParser.CasePartContext;
import com.bstek.ureport.dsl.ReportParserParser.ComplexExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.ElseIfPartContext;
import com.bstek.ureport.dsl.ReportParserParser.ElsePartContext;
import com.bstek.ureport.dsl.ReportParserParser.ExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.ExprContext;
import com.bstek.ureport.dsl.ReportParserParser.ExpressionContext;
import com.bstek.ureport.dsl.ReportParserParser.IfConditionContext;
@ -32,9 +34,12 @@ import com.bstek.ureport.dsl.ReportParserParser.IfExprContext;
import com.bstek.ureport.dsl.ReportParserParser.IfPartContext;
import com.bstek.ureport.dsl.ReportParserParser.ItemContext;
import com.bstek.ureport.dsl.ReportParserParser.JoinContext;
import com.bstek.ureport.dsl.ReportParserParser.ParenExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.ParenJoinContext;
import com.bstek.ureport.dsl.ReportParserParser.SimpleJoinContext;
import com.bstek.ureport.dsl.ReportParserParser.SingleExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.SingleParenJoinContext;
import com.bstek.ureport.dsl.ReportParserParser.TernaryExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.TernaryExprContext;
import com.bstek.ureport.dsl.ReportParserParser.UnitContext;
import com.bstek.ureport.exception.ReportParseException;
@ -63,12 +68,11 @@ public class ExpressionVisitor extends ReportParserBaseVisitor<Expression>{
}
@Override
public Expression visitExpression(ExpressionContext ctx) {
ExprContext exprContext=ctx.expr();
ExprCompositeContext exprCompositeContext=ctx.exprComposite();
IfExprContext ifExprContext=ctx.ifExpr();
CaseExprContext caseExprContext=ctx.caseExpr();
TernaryExprContext ternaryExprContext=ctx.ternaryExpr();
if(exprContext!=null){
return parseExpr(exprContext);
if(exprCompositeContext!=null){
return parseExprComposite(exprCompositeContext);
}else if(ifExprContext!=null){
IfExpression expr=new IfExpression();
expr.setExpr(ctx.getText());
@ -122,7 +126,22 @@ public class ExpressionVisitor extends ReportParserBaseVisitor<Expression>{
elseIfExpressionList.add(elseIfExpr);
}
return expr;
}else if(ternaryExprContext!=null){
}else{
throw new ReportParseException("Expression ["+ctx.getText()+"] is invalid.");
}
}
private Expression parseExprComposite(ExprCompositeContext exprCompositeContext) {
if(exprCompositeContext instanceof SingleExprCompositeContext){
SingleExprCompositeContext singleExprCompositeContext=(SingleExprCompositeContext)exprCompositeContext;
ExprContext exprContext=singleExprCompositeContext.expr();
return parseExpr(exprContext);
}else if(exprCompositeContext instanceof ParenExprCompositeContext){
ParenExprCompositeContext parenExprCompositeContext=(ParenExprCompositeContext)exprCompositeContext;
ExprCompositeContext childExprCompositeContext=parenExprCompositeContext.exprComposite();
return parseExprComposite(childExprCompositeContext);
}else if(exprCompositeContext instanceof TernaryExprCompositeContext){
TernaryExprCompositeContext ternaryExprCompositeContext=(TernaryExprCompositeContext)exprCompositeContext;
TernaryExprContext ternaryExprContext=ternaryExprCompositeContext.ternaryExpr();
List<IfConditionContext> ifConditionContexts=ternaryExprContext.ifCondition();
IfExpression expr=new IfExpression();
expr.setConditionList(parseCondtionList(ifConditionContexts, ternaryExprContext.join()));
@ -133,10 +152,27 @@ public class ExpressionVisitor extends ReportParserBaseVisitor<Expression>{
elseExpr.setExpression(parseExpr(secondExprContext));
expr.setElseExpression(elseExpr);
return expr;
}else if(exprCompositeContext instanceof ComplexExprCompositeContext){
ComplexExprCompositeContext complexExprCompositeContext=(ComplexExprCompositeContext)exprCompositeContext;
ExprCompositeContext leftExprCompositeContext=complexExprCompositeContext.exprComposite(0);
Expression leftExpression=parseExprComposite(leftExprCompositeContext);
ExprCompositeContext rightExprCompositeContext=complexExprCompositeContext.exprComposite(1);
Expression rightExpression=parseExprComposite(rightExprCompositeContext);
String op=complexExprCompositeContext.Operator().getText();
Operator operator=Operator.parse(op);
List<BaseExpression> expressions=new ArrayList<BaseExpression>();
expressions.add((BaseExpression)leftExpression);
expressions.add((BaseExpression)rightExpression);
List<Operator> operators=new ArrayList<Operator>();
operators.add(operator);
ParenExpression expression=new ParenExpression(operators, expressions);
expression.setExpr(complexExprCompositeContext.getText());
return expression;
}else{
throw new ReportParseException("Expression ["+ctx.getText()+"] is invalid.");
throw new ReportParseException("Unknow context :"+exprCompositeContext);
}
}
private Expression parseExpr(ExprContext exprContext) {
List<BaseExpression> expressions=new ArrayList<BaseExpression>();
List<Operator> operators=new ArrayList<Operator>();

5
ureport2-core/src/main/resources/ureport-core-context.xml

@ -5,10 +5,13 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
">
<bean id="ureport.props" class="com.bstek.ureport.UReportPropertyPlaceholderConfigurer" abstract="true"></bean>
<bean id="ureport.props" class="com.bstek.ureport.UReportPropertyPlaceholderConfigurer" abstract="true">
<property name="ignoreUnresolvablePlaceholders" value="true"></property>
</bean>
<bean id="ureport.propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:ureport.properties"></property>
<property name="ignoreUnresolvablePlaceholders" value="true"></property>
</bean>
<bean id="ureport.exportManager" class="com.bstek.ureport.export.ExportManagerImpl">

316
ureport2-core/src/main/resources/ureport2.xsd

@ -251,6 +251,322 @@
</attribute>
</complexType>
<complexType name="chart-value">
<sequence>
<element name="xaxes" type="tns:xaxes" minOccurs="0" maxOccurs="1"></element>
<element name="yaxes" type="tns:yaxes" minOccurs="0" maxOccurs="1"></element>
<element name="dataset" type="tns:chart-dataset" minOccurs="1" maxOccurs="1"></element>
<element name="animations-option" type="tns:animations-option" minOccurs="0" maxOccurs="1"></element>
<element name="title-option" type="tns:title-option" minOccurs="0" maxOccurs="1"></element>
<element name="legend-option" type="tns:legend-option" minOccurs="0" maxOccurs="1"></element>
<element name="tooltip-option" type="tns:tooltip-option" minOccurs="0" maxOccurs="1"></element>
<element name="layout-option" type="tns:layout-option" minOccurs="0" maxOccurs="1"></element>
</sequence>
</complexType>
<complexType name="title-option">
<attribute name="display" type="boolean"></attribute>
<attribute name="font-size" type="int"></attribute>
<attribute name="font-color" type="string"></attribute>
<attribute name="padding" type="int"></attribute>
<attribute name="text" type="string"></attribute>
<attribute name="font-style">
<simpleType>
<restriction base="string">
<enumeration value="normal"></enumeration>
<enumeration value="italic"></enumeration>
<enumeration value="bold"></enumeration>
</restriction>
</simpleType>
</attribute>
<attribute name="position">
<simpleType>
<restriction base="string">
<enumeration value="top"></enumeration>
<enumeration value="bottom"></enumeration>
<enumeration value="left"></enumeration>
<enumeration value="right"></enumeration>
</restriction>
</simpleType>
</attribute>
</complexType>
<complexType name="tooltip-option">
<attribute name="enabled" type="boolean"></attribute>
<attribute name="title-font-size" type="int"></attribute>
<attribute name="body-font-size" type="int"></attribute>
<attribute name="title-font-color" type="string"></attribute>
<attribute name="body-font-color" type="string"></attribute>
<attribute name="title-font-style">
<simpleType>
<restriction base="string">
<enumeration value="normal"></enumeration>
<enumeration value="italic"></enumeration>
<enumeration value="bold"></enumeration>
</restriction>
</simpleType>
</attribute>
<attribute name="body-font-style">
<simpleType>
<restriction base="string">
<enumeration value="normal"></enumeration>
<enumeration value="italic"></enumeration>
<enumeration value="bold"></enumeration>
</restriction>
</simpleType>
</attribute>
</complexType>
<complexType name="legend-option">
<sequence>
<element name="labels" type="tns:labels" minOccurs="1" maxOccurs="1"></element>
</sequence>
<attribute name="display" type="boolean"></attribute>
<attribute name="position">
<simpleType>
<restriction base="string">
<enumeration value="left"></enumeration>
<enumeration value="right"></enumeration>
<enumeration value="top"></enumeration>
<enumeration value="bottom"></enumeration>
</restriction>
</simpleType>
</attribute>
</complexType>
<complexType name="labels">
<attribute name="box-width" type="int"></attribute>
<attribute name="font-size" type="int"></attribute>
<attribute name="padding" type="int"></attribute>
<attribute name="font-color" type="string"></attribute>
<attribute name="font-style">
<simpleType>
<restriction base="string">
<enumeration value="normal"></enumeration>
<enumeration value="italic"></enumeration>
<enumeration value="bold"></enumeration>
</restriction>
</simpleType>
</attribute>
</complexType>
<complexType name="layout-option">
<attribute name="padding" type="int"></attribute>
</complexType>
<complexType name="animations-option">
<attribute name="duration" type="int"></attribute>
<attribute name="easing">
<simpleType>
<restriction base="string">
<enumeration value="linear"></enumeration>
<enumeration value="easeInQuad"></enumeration>
<enumeration value="easeOutQuad"></enumeration>
<enumeration value="easeInOutQuad"></enumeration>
<enumeration value="easeInCubic"></enumeration>
<enumeration value="easeOutCubic"></enumeration>
<enumeration value="easeInOutCubic"></enumeration>
<enumeration value="easeInQuart"></enumeration>
<enumeration value="easeOutQuart"></enumeration>
<enumeration value="easeInOutQuart"></enumeration>
<enumeration value="easeInQuint"></enumeration>
<enumeration value="easeOutQuint"></enumeration>
<enumeration value="easeInOutQuint"></enumeration>
<enumeration value="easeInSine"></enumeration>
<enumeration value="easeOutSine"></enumeration>
<enumeration value="easeInOutSine"></enumeration>
<enumeration value="easeInExpo"></enumeration>
<enumeration value="easeOutExpo"></enumeration>
<enumeration value="easeInOutExpo"></enumeration>
<enumeration value="easeInCirc"></enumeration>
<enumeration value="easeOutCirc"></enumeration>
<enumeration value="easeInOutCirc"></enumeration>
<enumeration value="easeInElastic"></enumeration>
<enumeration value="easeOutElastic"></enumeration>
<enumeration value="easeInOutElastic"></enumeration>
<enumeration value="easeInBack"></enumeration>
<enumeration value="easeOutBack"></enumeration>
<enumeration value="easeInOutBack"></enumeration>
<enumeration value="easeInBounce"></enumeration>
<enumeration value="easeOutBounce"></enumeration>
<enumeration value="easeInOutBounce"></enumeration>
</restriction>
</simpleType>
</attribute>
</complexType>
<complexType name="chart-dataset">
<choice>
<element name="area-dataset" type="tns:area-dataset"></element>
<element name="line-dataset" type="tns:line-dataset"></element>
<element name="bubble-dataset" type="tns:bubble-dataset"></element>
<element name="polar-dataset" type="tns:polar-dataset"></element>
<element name="bar-dataset" type="tns:bar-dataset"></element>
<element name="pie-dataset" type="tns:pie-dataset"></element>
<element name="scatter-dataset" type="tns:scatter-dataset"></element>
<element name="doughnut-dataset" type="tns:doughnut-dataset"></element>
<element name="radar-dataset" type="tns:radar-dataset"></element>
<element name="horizontal-bar-dataset" type="tns:horizontal-bar-dataset"></element>
<element name="mix-dataset" type="tns:mix-dataset"></element>
</choice>
</complexType>
<complexType name="mix-dataset">
<sequence>
<element name="bar-dataset" type="tns:bar-dataset" minOccurs="0" maxOccurs="unbounded"></element>
<element name="line-dataset" type="tns:line-dataset" minOccurs="0" maxOccurs="unbounded"></element>
</sequence>
</complexType>
<complexType name="category-dataset">
<attribute name="dataset-name" type="string"></attribute>
<attribute name="category-property" type="string"></attribute>
<attribute name="series-property" type="string"></attribute>
<attribute name="value-property" type="string"></attribute>
<attribute name="format" type="string"></attribute>
<attribute name="collect-type">
<simpleType>
<restriction base="string">
<enumeration value="select"></enumeration>
<enumeration value="count"></enumeration>
<enumeration value="sum"></enumeration>
<enumeration value="avg"></enumeration>
<enumeration value="max"></enumeration>
<enumeration value="min"></enumeration>
</restriction>
</simpleType>
</attribute>
</complexType>
<complexType name="bubble-dataset">
<attribute name="dataset-name" type="string"></attribute>
<attribute name="x-property" type="string"></attribute>
<attribute name="y-property" type="string"></attribute>
<attribute name="category-property" type="string"></attribute>
<attribute name="line-tension" type="double"></attribute>
<attribute name="fill" type="boolean"></attribute>
</complexType>
<complexType name="scatter-dataset">
<attribute name="dataset-name" type="string"></attribute>
<attribute name="x-property" type="string"></attribute>
<attribute name="y-property" type="string"></attribute>
<attribute name="r-property" type="string"></attribute>
<attribute name="category-property" type="string"></attribute>
</complexType>
<complexType name="line-dataset">
<complexContent>
<extension base="tns:category-dataset">
<attribute name="line-tension" type="double"></attribute>
</extension>
</complexContent>
</complexType>
<complexType name="bar-dataset">
<complexContent>
<extension base="tns:category-dataset">
</extension>
</complexContent>
</complexType>
<complexType name="horizontal-bar-dataset">
<complexContent>
<extension base="tns:category-dataset">
</extension>
</complexContent>
</complexType>
<complexType name="area-dataset">
<complexContent>
<extension base="tns:category-dataset">
</extension>
</complexContent>
</complexType>
<complexType name="doughnut-dataset">
<complexContent>
<extension base="tns:category-dataset">
</extension>
</complexContent>
</complexType>
<complexType name="pie-dataset">
<complexContent>
<extension base="tns:category-dataset">
</extension>
</complexContent>
</complexType>
<complexType name="polar-dataset">
<complexContent>
<extension base="tns:category-dataset">
</extension>
</complexContent>
</complexType>
<complexType name="radar-dataset">
<complexContent>
<extension base="tns:category-dataset">
<attribute name="line-tension" type="double"></attribute>
<attribute name="fill" type="boolean"></attribute>
</extension>
</complexContent>
</complexType>
<complexType name="axes" abstract="true">
<sequence>
<element name="scale-label" type="tns:scale-label" minOccurs="0" maxOccurs="1"></element>
</sequence>
<attribute name="rotation" type="int"></attribute>
</complexType>
<complexType name="scale-label">
<attribute name="display" type="boolean"></attribute>
<attribute name="label-string" type="string"></attribute>
<attribute name="font-color" type="string"></attribute>
<attribute name="font-size" type="int"></attribute>
<attribute name="font-style">
<simpleType>
<restriction base="string">
<enumeration value="normal"></enumeration>
<enumeration value="italic"></enumeration>
<enumeration value="bold"></enumeration>
</restriction>
</simpleType>
</attribute>
</complexType>
<complexType name="xaxes">
<complexContent>
<extension base="tns:axes">
<attribute name="xposition">
<simpleType>
<restriction base="string">
<enumeration value="top"></enumeration>
<enumeration value="bottom"></enumeration>
</restriction>
</simpleType>
</attribute>
</extension>
</complexContent>
</complexType>
<complexType name="yaxes">
<complexContent>
<extension base="tns:axes">
<attribute name="xposition">
<simpleType>
<restriction base="string">
<enumeration value="left"></enumeration>
<enumeration value="right"></enumeration>
</restriction>
</simpleType>
</attribute>
</extension>
</complexContent>
</complexType>
<complexType name="zxing-value">
<sequence>
<element name="text" type="tns:text" minOccurs="0" maxOccurs="1"></element>

Notiek ielāde…
Atcelt
Saglabāt