提交 d4e20e0e 编写于 作者: tony001's avatar tony001

补充雷达图

上级 17badfd5
...@@ -270,7 +270,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -270,7 +270,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
<#if appDataSet.getMajorSortDir()?? && appDataSet.getMajorSortPSDEField()??> <#if appDataSet.getMajorSortDir()?? && appDataSet.getMajorSortPSDEField()??>
Object.assign(arg,{sort: '${appDataSet.getMajorSortPSDEField().getCodeName()?lower_case},${appDataSet.getMajorSortDir()?lower_case}'}); Object.assign(arg,{sort: '${appDataSet.getMajorSortPSDEField().getCodeName()?lower_case},${appDataSet.getMajorSortDir()?lower_case}'});
</#if> </#if>
<#if appDataSet.getPageSize()??> <#if appDataSet.getPageSize()?? && appDataSet.getPageSize() != -1>
Object.assign(arg,{size:${appDataSet.getPageSize()?c}}); Object.assign(arg,{size:${appDataSet.getPageSize()?c}});
</#if> </#if>
</#if> </#if>
...@@ -340,7 +340,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -340,7 +340,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
if(tempSeries.type && Object.is(tempSeries.type,'radar') && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0){ if(tempSeries.type && Object.is(tempSeries.type,'radar') && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0){
let tempIndicator:any = []; let tempIndicator:any = [];
tempSeries.seriesValues.forEach((item:any) =>{ tempSeries.seriesValues.forEach((item:any) =>{
let singleIndicatorObj:any = {name:item,max:100}; let singleIndicatorObj:any = {name:item,max:this.computeMaxValue(tempSeries)};
tempIndicator.push(singleIndicatorObj); tempIndicator.push(singleIndicatorObj);
}) })
this.chartOption.radar = {'indicator':tempIndicator}; this.chartOption.radar = {'indicator':tempIndicator};
...@@ -369,6 +369,30 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -369,6 +369,30 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
} }
} }
/**
* 计算雷达图最大值
*
*
* @param {*} tempSeries 当前序列
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public computeMaxValue(tempSeries:any){
let tempArray:Array<any> = [];
let chartData:Array<any> = tempSeries.data;
let seriesValues:Array<any> = tempSeries.seriesValues;
if(chartData && chartData.length >0 && seriesValues && seriesValues.length >0){
seriesValues.forEach((seriesValue:any) =>{
chartData.forEach((singleData:any) =>{
tempArray.push(singleData[seriesValue]);
})
})
tempArray.sort((a:any, b:any) => {
return a - b;
});
}
return tempArray.length>0?(tempArray[tempArray.length - 1] + 20):50;
}
/** /**
* 实体数据集转化为图表数据集 * 实体数据集转化为图表数据集
* *
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册